diff options
author | Andrea Canciani <ranma42@gmail.com> | 2011-08-05 19:44:33 +0200 |
---|---|---|
committer | Andrea Canciani <ranma42@gmail.com> | 2011-08-05 19:44:33 +0200 |
commit | 588e5a24fad80269437aebc36dc316616504edab (patch) | |
tree | b8fffc6c02aa98fade7e3e5c2004adff3956f1b4 /src/cairo-surface-clipper.c | |
parent | 9ef003c5fce30956fefb2f4d9a1ded85cb296b4f (diff) | |
download | cairo-588e5a24fad80269437aebc36dc316616504edab.tar.gz |
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.
Diffstat (limited to 'src/cairo-surface-clipper.c')
-rw-r--r-- | src/cairo-surface-clipper.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/cairo-surface-clipper.c b/src/cairo-surface-clipper.c index 8429db77d..1282eb24a 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, |