From a6ffb69a54f15659dac7c6b2e1c98bd7893ccdf1 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 3 Apr 2009 17:28:05 +0100 Subject: [type3] Check error status before emit_image(). Be careful not to pass an error object down to emit_image() hook, propagate the error instead. This relieves the burden of the error check from the callee -- which was causing an assertion failure in the ps backend. --- src/cairo-type3-glyph-surface.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/cairo-type3-glyph-surface.c') diff --git a/src/cairo-type3-glyph-surface.c b/src/cairo-type3-glyph-surface.c index 3ff5003bf..c52915f77 100644 --- a/src/cairo-type3-glyph-surface.c +++ b/src/cairo-type3-glyph-surface.c @@ -88,6 +88,12 @@ _cairo_type3_glyph_surface_emit_image (cairo_type3_glyph_surface_t *surface, { cairo_status_t status; + /* The only image type supported by Type 3 fonts are 1-bit masks */ + image = _cairo_image_surface_coerce (image, CAIRO_FORMAT_A1); + status = image->base.status; + if (unlikely (status)) + return status; + _cairo_output_stream_printf (surface->stream, "q %f %f %f %f %f %f cm\n", image_matrix->xx, @@ -97,8 +103,6 @@ _cairo_type3_glyph_surface_emit_image (cairo_type3_glyph_surface_t *surface, image_matrix->x0, image_matrix->y0); - /* The only image type supported by Type 3 fonts are 1-bit masks */ - image = _cairo_image_surface_coerce (image, CAIRO_FORMAT_A1); status = surface->emit_image (image, surface->stream); cairo_surface_destroy (&image->base); -- cgit v1.2.1