summaryrefslogtreecommitdiff
path: root/src/cairo-type1-fallback.c
diff options
context:
space:
mode:
authorAdrian Johnson <ajohnson@redneon.com>2007-12-02 00:50:28 +1030
committerAdrian Johnson <ajohnson@redneon.com>2007-12-02 00:50:28 +1030
commit1441e165f2338bc6a8e2945baca77611ff417b2f (patch)
tree1c9734c6a65ea51d7f61958bb299e6d828c8dd95 /src/cairo-type1-fallback.c
parente6166f7b442ae55128b417559e48250c287e49b6 (diff)
downloadcairo-1441e165f2338bc6a8e2945baca77611ff417b2f.tar.gz
Fix regression in Type1 Fallback
As a result of the changes to improve the status checking, _cairo_type2_charstrings_init() was failing due to the failure status returned when the font->output stream is destroyed. This is because _cairo_type2_charstrings_init() does not create an output stream. Fix this by initializing font->output to NULL and only destroy it if not NULL.
Diffstat (limited to 'src/cairo-type1-fallback.c')
-rw-r--r--src/cairo-type1-fallback.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/cairo-type1-fallback.c b/src/cairo-type1-fallback.c
index 626c7b5d3..3532692ce 100644
--- a/src/cairo-type1-fallback.c
+++ b/src/cairo-type1-fallback.c
@@ -110,6 +110,7 @@ cairo_type1_font_create (cairo_scaled_font_subset_t *scaled_font_subset,
goto fail;
_cairo_array_init (&font->contents, sizeof (unsigned char));
+ font->output = NULL;
*subset_return = font;
@@ -709,12 +710,13 @@ cairo_type1_font_generate (cairo_type1_font_t *font, const char *name)
static cairo_status_t
cairo_type1_font_destroy (cairo_type1_font_t *font)
{
- cairo_status_t status;
+ cairo_status_t status = CAIRO_STATUS_SUCCESS;
free (font->widths);
cairo_scaled_font_destroy (font->type1_scaled_font);
_cairo_array_fini (&font->contents);
- status = _cairo_output_stream_destroy (font->output);
+ if (font->output)
+ status = _cairo_output_stream_destroy (font->output);
free (font);
return status;