[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:
Chris Wilson 2007-05-12 12:36:47 +01:00
parent 6a43c02723
commit 35a2ed0335

View file

@ -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;