[cairo-commit] src/cairo-surface-clipper.c

Andrea Canciani ranma42 at kemper.freedesktop.org
Fri Aug 5 10:51:12 PDT 2011


 src/cairo-surface-clipper.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 588e5a24fad80269437aebc36dc316616504edab
Author: Andrea Canciani <ranma42 at gmail.com>
Date:   Fri Aug 5 19:44:33 2011 +0200

    clipper: Fix crashes
    
    The end of the clip path list is marked with NULL, so we should stop
    iterating paths when we reach it.
    
    The assertion was meant to check if paths had the same content, not if
    they have the same address.
    
    Fixes clip-fill-rule and clip-twice in cairo-quartz.

diff --git a/src/cairo-surface-clipper.c b/src/cairo-surface-clipper.c
index 8429db7..1282eb2 100644
--- a/src/cairo-surface-clipper.c
+++ b/src/cairo-surface-clipper.c
@@ -142,11 +142,10 @@ _cairo_surface_clipper_set_clip (cairo_surface_clipper_t *clipper,
 		sizeof (cairo_box_t) * clip->num_boxes) == 0)
     {
 	cairo_clip_path_t *clip_path = clip->path;
-	while (clip_path != clipper->clip->path)
+	while (clip_path != NULL && clip_path != clipper->clip->path)
 	    clip_path = clip_path->prev;
 
 	if (clip_path) {
-	    assert (clip_path != clipper->clip->path);
 	    incremental = TRUE;
 	    status = _cairo_surface_clipper_intersect_clip_path_recursive (clipper,
 									   clip->path,


More information about the cairo-commit mailing list