diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2007-10-03 23:25:10 +0100 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2007-11-26 21:24:46 -0800 |
commit | 3454ef0984299d19e79ceb705a84c4a706704e29 (patch) | |
tree | 15fc0250bb330ea4790f6524839aa804529c33f2 /src/cairo-image-surface.c | |
parent | a5b74da68bcebaecaa4cbb252bc15b6bec32f847 (diff) |
[malloc] Take advantage of calloc() argument checking.
calloc() will check its arguments for integer overflows so it is safer
not to pre-multiply them.
(cherry picked from commit 66664596559c55913fb0b9c8784fe8ab862c217b)
Diffstat (limited to 'src/cairo-image-surface.c')
-rw-r--r-- | src/cairo-image-surface.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cairo-image-surface.c b/src/cairo-image-surface.c index ad41a4cba..27287fad2 100644 --- a/src/cairo-image-surface.c +++ b/src/cairo-image-surface.c @@ -988,7 +988,7 @@ _cairo_image_surface_composite_trapezoids (cairo_operator_t op, } /* The image must be initially transparent */ - mask_data = calloc (1, mask_stride * height); + mask_data = calloc (mask_stride, height); if (mask_data == NULL) { status = CAIRO_STATUS_NO_MEMORY; goto CLEANUP_SOURCE; |