diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2009-04-03 17:28:05 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2009-04-16 09:34:03 +0100 |
commit | a6ffb69a54f15659dac7c6b2e1c98bd7893ccdf1 (patch) | |
tree | cf5dbe8364bb978fcbb85e43aad93bd61c604331 /src/cairo-type3-glyph-surface.c | |
parent | 21d1138da9bcf9c006e0cf3f3d1d50e1c7cec1de (diff) | |
download | cairo-a6ffb69a54f15659dac7c6b2e1c98bd7893ccdf1.tar.gz |
[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.
Diffstat (limited to 'src/cairo-type3-glyph-surface.c')
-rw-r--r-- | src/cairo-type3-glyph-surface.c | 8 |
1 files changed, 6 insertions, 2 deletions
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); |