clip: Fix clip-equal to handle one or the other being NULL/all-clipped

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2011-07-29 12:35:36 +01:00
parent 7c6e1b8db8
commit fb9ed9bb0d

View file

@ -346,6 +346,16 @@ _cairo_clip_equal (const cairo_clip_t *clip_a,
if (clip_a == clip_b)
return TRUE;
/* or just one of them? */
if (clip_a == NULL || clip_b == NULL ||
_cairo_clip_is_all_clipped (clip_a) ||
_cairo_clip_is_all_clipped (clip_b))
{
return FALSE;
}
/* We have a pair of normal clips, check their contents */
if (clip_a->num_boxes != clip_b->num_boxes)
return FALSE;