From 08b9984da9f2119cd4ed03bbd656a349b49d1f12 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 4 May 2010 08:19:41 +0100 Subject: [PATCH] image: Replace assert with error return It is possible to encounter an allocation failure here since we may have tweaked the clip since the last evaluation of the clip region. --- src/cairo-image-surface.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cairo-image-surface.c b/src/cairo-image-surface.c index 21cfe4d75..f5b5aab62 100644 --- a/src/cairo-image-surface.c +++ b/src/cairo-image-surface.c @@ -2191,8 +2191,9 @@ _clip_and_composite (cairo_image_surface_t *dst, status = _cairo_clip_get_region (clip, &clip_region); if (unlikely (status == CAIRO_INT_STATUS_NOTHING_TO_DO)) return CAIRO_STATUS_SUCCESS; + if (unlikely (_cairo_status_is_error (status))) + return status; - assert (! _cairo_status_is_error (status)); need_clip_surface = status == CAIRO_INT_STATUS_UNSUPPORTED; if (clip_region != NULL) {