From bd17b898b1c249aa0dc443bc303bad4fea8690bc Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 14 Apr 2010 19:11:15 +0100 Subject: [PATCH] surface: Propagate the error status to _cairo_surface_get_device() If the surface is in error, the appropriate action is report the error using an inert error cairo_device_t. Reported-by: Benjamin Otte --- src/cairo-surface.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/cairo-surface.c b/src/cairo-surface.c index 9a3d329d0..865462dab 100644 --- a/src/cairo-surface.c +++ b/src/cairo-surface.c @@ -231,6 +231,9 @@ _cairo_surface_allocate_unique_id (void) cairo_device_t * cairo_surface_get_device (cairo_surface_t *surface) { + if (unlikely (surface->status)) + return _cairo_device_create_in_error (surface->status); + return surface->device; }