summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUli Schlachter <psychon@znc.in>2013-08-12 13:59:18 (GMT)
committerUli Schlachter <psychon@znc.in>2013-08-13 17:21:57 (GMT)
commit3c4e0f0f1a338fbbd802cdb3b65b8ea3abc758d1 (patch)
treeadabe24d3a20fdd2248c1876f71a4130dff6b54c
parent18633b081026eb88931af6130b3e716fdb954e19 (diff)
downloadcairo-3c4e0f0f1a338fbbd802cdb3b65b8ea3abc758d1.tar.gz
cairo-3c4e0f0f1a338fbbd802cdb3b65b8ea3abc758d1.tar.xz
push_group: Refuse working with unusable surface
Make cairo_push_group() fail when the context's target surface is finished. This fixes the api-special-cases for the xcb backend: Detected error during xcb run: error=9, seqno=0x13c, major=53, minor=0 The problem was that the Pixmap for the cairo surface was already freed and cairo still tried to use it again as the drawable in a CreatePixmap request. Signed-off-by: Uli Schlachter <psychon@znc.in> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/cairo-default-context.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/cairo-default-context.c b/src/cairo-default-context.c
index fee08f0..aec5b10 100644
--- a/src/cairo-default-context.c
+++ b/src/cairo-default-context.c
@@ -153,6 +153,11 @@ _cairo_default_context_push_group (void *abstract_cr, cairo_content_t content)
parent_surface = _cairo_gstate_get_target (cr->gstate);
+ if (unlikely (parent_surface->status))
+ return parent_surface->status;
+ if (unlikely (parent_surface->finished))
+ return _cairo_error (CAIRO_STATUS_SURFACE_FINISHED);
+
/* Get the extents that we'll use in creating our new group surface */
bounded = _cairo_surface_get_extents (parent_surface, &extents);
if (clip)