summaryrefslogtreecommitdiff
path: root/src/cairo-type3-glyph-surface.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2009-04-03 17:28:05 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2009-04-16 09:34:03 +0100
commita6ffb69a54f15659dac7c6b2e1c98bd7893ccdf1 (patch)
treecf5dbe8364bb978fcbb85e43aad93bd61c604331 /src/cairo-type3-glyph-surface.c
parent21d1138da9bcf9c006e0cf3f3d1d50e1c7cec1de (diff)
downloadcairo-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.c8
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);