diff options
Diffstat (limited to 'src/cairo-png.c')
-rw-r--r-- | src/cairo-png.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/cairo-png.c b/src/cairo-png.c index 0e2f4b0f5..359f94d9a 100644 --- a/src/cairo-png.c +++ b/src/cairo-png.c @@ -199,7 +199,7 @@ write_png (cairo_surface_t *surface, * by coercing them to a simpler format using pixman. */ clone = _cairo_image_surface_coerce (image); - status = clone->base.status; + status = _cairo_surface_status (&clone->base); if (unlikely (status)) goto BAIL1; @@ -355,8 +355,9 @@ cairo_surface_write_to_png (cairo_surface_t *surface, FILE *fp; cairo_status_t status; - if (surface->status) - return surface->status; + status = _cairo_surface_status (surface); + if (unlikely (status)) + return status; if (surface->finished) return CAIRO_ERROR_SURFACE_FINISHED; @@ -420,9 +421,11 @@ cairo_surface_write_to_png_stream (cairo_surface_t *surface, void *closure) { struct png_write_closure_t png_closure; + cairo_status_t status; - if (surface->status) - return surface->status; + status = _cairo_surface_status (surface); + if (unlikely (status)) + return status; if (surface->finished) return CAIRO_ERROR_SURFACE_FINISHED; @@ -677,7 +680,7 @@ read_png (struct png_read_closure_t *png_closure) surface = cairo_image_surface_create_for_data (data, format, png_width, png_height, stride); - if (surface->status) + if (_cairo_surface_status (surface)) goto BAIL; _cairo_image_surface_assume_ownership_of_data ((cairo_image_surface_t*)surface); |