mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-01-06 13:10:33 +01:00
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.
This commit is contained in:
parent
e6166f7b44
commit
1441e165f2
1 changed files with 4 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue