mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-08 13:48:02 +02:00
Move misplaced CLEANUP_FONT label to avoid crash.
Previously, a failure in _cairo_win32_scaled_font_init_glyph_path leading to the CLEANUP_FONT label would set the path into the glyph, then destroy the path, and return an error status, (which in turn would cause a double free when the glyph was destroyed). The double-free apparently leads to a crash in some cases, as described here: SVG/Cairo related crash when opening specific webpage https://bugzilla.mozilla.org/show_bug.cgi?id=376498 This should eliminate the double-free, but does not address the original error case, (attempting to get a path from a bitmap font?).
This commit is contained in:
parent
5c24711ee6
commit
106f859045
1 changed files with 1 additions and 3 deletions
|
|
@ -1451,16 +1451,14 @@ _cairo_win32_scaled_font_init_glyph_path (cairo_win32_scaled_font_t *scaled_font
|
|||
}
|
||||
free(buffer);
|
||||
|
||||
CLEANUP_FONT:
|
||||
|
||||
_cairo_scaled_glyph_set_path (scaled_glyph,
|
||||
&scaled_font->base,
|
||||
path);
|
||||
|
||||
CLEANUP_FONT:
|
||||
cairo_win32_scaled_font_done_font (&scaled_font->base);
|
||||
|
||||
CLEANUP_PATH:
|
||||
|
||||
if (status != CAIRO_STATUS_SUCCESS)
|
||||
_cairo_path_fixed_destroy (path);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue