diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2009-06-28 01:17:13 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2009-06-28 01:17:13 +0100 |
commit | 663da31bbe7cf6021c8d59a4d4ddd2702cfe860f (patch) | |
tree | 100a736b941f7cf7f6ccfa3497b8bf31279e1b0e /boilerplate/cairo-boilerplate.c | |
parent | 2bbb69420289aa372512602db312611369e70f54 (diff) | |
download | cairo-663da31bbe7cf6021c8d59a4d4ddd2702cfe860f.tar.gz |
[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/cairo-boilerplate.c')
-rw-r--r-- | boilerplate/cairo-boilerplate.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/boilerplate/cairo-boilerplate.c b/boilerplate/cairo-boilerplate.c index 1b0fa2945..285b23aaf 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; |