diff options
author | Adrian Johnson <ajohnson@redneon.com> | 2007-12-02 00:50:28 +1030 |
---|---|---|
committer | Adrian Johnson <ajohnson@redneon.com> | 2007-12-12 22:30:18 +1030 |
commit | 5c3f22816f8324d2847b885e4c9c3e94837ce2bc (patch) | |
tree | 2ff3b476eefd9cbc5293f6173cb681eb1d06b0f3 | |
parent | a94dc7499bd9bcff0e562bb81eba4e8c74e97163 (diff) | |
download | cairo-5c3f22816f8324d2847b885e4c9c3e94837ce2bc.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.
(cherry picked from commit 1441e165f2338bc6a8e2945baca77611ff417b2f)
-rw-r--r-- | src/cairo-type1-fallback.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/cairo-type1-fallback.c b/src/cairo-type1-fallback.c index 387277785..0ad781743 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; @@ -697,12 +698,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; |