diff options
author | Søren Sandmann Pedersen <sandmann@annarchy.freedesktop.org> | 2007-07-02 08:33:29 -0700 |
---|---|---|
committer | Søren Sandmann Pedersen <sandmann@annarchy.freedesktop.org> | 2007-07-02 08:33:29 -0700 |
commit | ef967be630dd8d0bf81ad5889d6264bebe7631d4 (patch) | |
tree | bd13259091acc26ed8563790f04982f509351a62 /src/cairo-clip.c | |
parent | 0c42dbb1925efb8228fb5246e0715bee0a5ded28 (diff) | |
parent | 5c7d2d14d78e4dfb1ef6d2c40f0910f177e07360 (diff) |
Merge branch 'master' of git+ssh://sandmann@git.freedesktop.org/git/cairo
Conflicts:
pixman/src/fbcompose.c
pixman/src/icimage.c
pixman/src/pixmanint.h
pixman/src/pixregionint.h
src/cairo-clip.c
Diffstat (limited to 'src/cairo-clip.c')
-rw-r--r-- | src/cairo-clip.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/cairo-clip.c b/src/cairo-clip.c index 6aa264e6..abc50334 100644 --- a/src/cairo-clip.c +++ b/src/cairo-clip.c @@ -624,9 +624,13 @@ _cairo_clip_copy_rectangle_list (cairo_clip_t *clip, cairo_gstate_t *gstate) return (cairo_rectangle_list_t*) &_cairo_rectangles_not_representable; n_boxes = clip->has_region ? pixman_region_n_rects (&clip->region) : 1; - rectangles = malloc (sizeof (cairo_rectangle_t)*n_boxes); - if (rectangles == NULL) - return (cairo_rectangle_list_t*) &_cairo_rectangles_nil; + if (n_boxes > 0) { + rectangles = _cairo_malloc_ab (n_boxes, sizeof (cairo_rectangle_t)); + if (rectangles == NULL) + return (cairo_rectangle_list_t*) &_cairo_rectangles_nil; + } else { + rectangles = NULL; + } if (clip->has_region) { pixman_box16_t *boxes; |