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.
This commit is contained in:
Andrea Canciani 2011-08-05 19:44:33 +02:00
parent 9ef003c5fc
commit 588e5a24fa

View file

@ -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,