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 <otte@redhat.com>
This commit is contained in:
Chris Wilson 2010-04-14 19:11:15 +01:00
parent 005596907f
commit bd17b898b1

View file

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