[cairo-commit] src/cairo-clip.c

Andrea Canciani ranma42 at kemper.freedesktop.org
Sat Jul 30 09:01:03 PDT 2011


 src/cairo-clip.c |    3 +++
 1 file changed, 3 insertions(+)

New commits:
commit c13324311137a01286d1712ac8a33644f294c1ad
Author: Andrea Canciani <ranma42 at gmail.com>
Date:   Sat Jul 30 10:54:07 2011 +0200

    clip: Fix copy of clip rectangles list
    
    _cairo_clip_get_region() returns NULL both for non-region clips and
    for memory allocaiton failures. They must be distinguished by checking
    _cairo_clip_is_region().
    
    Fixes get-clip.

diff --git a/src/cairo-clip.c b/src/cairo-clip.c
index 4058879..6355a97 100644
--- a/src/cairo-clip.c
+++ b/src/cairo-clip.c
@@ -639,6 +639,9 @@ _cairo_clip_copy_rectangle_list (cairo_clip_t *clip, cairo_gstate_t *gstate)
     if (_cairo_clip_is_all_clipped (clip))
 	goto DONE;
 
+    if (! _cairo_clip_is_region (clip))
+	return ERROR_LIST (CAIRO_STATUS_CLIP_NOT_REPRESENTABLE);
+
     region = _cairo_clip_get_region (clip);
     if (region == NULL)
 	return ERROR_LIST (CAIRO_STATUS_NO_MEMORY);


More information about the cairo-commit mailing list