[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.
This commit is contained in:
Chris Wilson 2009-06-28 01:17:13 +01:00
parent 2bbb694202
commit 663da31bbe

View file

@ -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;