From 663da31bbe7cf6021c8d59a4d4ddd2702cfe860f Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sun, 28 Jun 2009 01:17:13 +0100 Subject: [PATCH] [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. --- boilerplate/cairo-boilerplate.c | 2 ++ 1 file changed, 2 insertions(+) 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;