mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-01-31 15:40:28 +01:00
[cairo-ft-font] Destroy surface if glyph transformation fails.
As we allocated the surface we need to destroy it if we encounter an error.
This commit is contained in:
parent
6a43c02723
commit
35a2ed0335
1 changed files with 4 additions and 1 deletions
|
|
@ -1964,9 +1964,12 @@ _cairo_ft_scaled_glyph_init (void *abstract_font,
|
|||
} else {
|
||||
status = _render_glyph_bitmap (face, &scaled_font->ft_options.base,
|
||||
&surface);
|
||||
if (status == CAIRO_STATUS_SUCCESS && unscaled->have_shape)
|
||||
if (status == CAIRO_STATUS_SUCCESS && unscaled->have_shape) {
|
||||
status = _transform_glyph_bitmap (&unscaled->current_shape,
|
||||
&surface);
|
||||
if (status)
|
||||
cairo_surface_destroy (&surface->base);
|
||||
}
|
||||
}
|
||||
if (status)
|
||||
goto FAIL;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue