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.
This commit is contained in:
Andrea Canciani 2011-07-30 10:54:07 +02:00
parent 6155348966
commit c133243111

View file

@ -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);