summaryrefslogtreecommitdiff
path: root/boilerplate
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2009-06-28 01:17:13 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2009-06-28 01:17:13 +0100
commit663da31bbe7cf6021c8d59a4d4ddd2702cfe860f (patch)
tree100a736b941f7cf7f6ccfa3497b8bf31279e1b0e /boilerplate
parent2bbb69420289aa372512602db312611369e70f54 (diff)
[boilerplate] Propagate original error from create_from_png()
During cairo_boilerplate_get_image_surface_from_png() the original status returned by cairo_image_surface_create_from_png() could have been masked by inappropriate context construction when flattening or extracting. Simply check after creating the surface from the png file, and return immediately if in error.
Diffstat (limited to 'boilerplate')
-rw-r--r--boilerplate/cairo-boilerplate.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/boilerplate/cairo-boilerplate.c b/boilerplate/cairo-boilerplate.c
index 1b0fa294..285b23aa 100644
--- a/boilerplate/cairo-boilerplate.c
+++ b/boilerplate/cairo-boilerplate.c
@@ -225,6 +225,8 @@ cairo_boilerplate_get_image_surface_from_png (const char *filename,
cairo_surface_t *surface;
surface = cairo_image_surface_create_from_png (filename);
+ if (cairo_surface_status (surface))
+ return surface;
if (flatten) {
cairo_t *cr;