mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-01-03 10:30:24 +01:00
[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:
parent
2bbb694202
commit
663da31bbe
1 changed files with 2 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue