From 905c345df1f828551af2ab0b751388428e4dfaf6 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 30 Apr 2010 10:31:50 +0100 Subject: [PATCH] recording: Check that we do not use a finished recording surface. User paranoia - as the replay is exposed to the user it is convenient to add the finish check in the core replay function so that we gain a paranoia check for the internal paths as well. --- src/cairo-recording-surface.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cairo-recording-surface.c b/src/cairo-recording-surface.c index 35fe6b16b..5a2f80447 100644 --- a/src/cairo-recording-surface.c +++ b/src/cairo-recording-surface.c @@ -801,7 +801,10 @@ _cairo_recording_surface_replay_internal (cairo_surface_t *surface, return surface->status; if (unlikely (target->status)) - return _cairo_surface_set_error (surface, target->status); + return target->status; + + if (unlikely (surface->finished)) + return _cairo_error (CAIRO_STATUS_SURFACE_FINISHED); assert (_cairo_surface_is_recording (surface));