summaryrefslogtreecommitdiff
path: root/Xext
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2015-03-21 11:07:24 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2015-04-21 16:57:07 -0700
commitf3ba909753cd216fc9eca4618a76cc283ccbf51e (patch)
tree1b48b1c08c341b26ed8d74e339308893021dccbe /Xext
parenta28202a148508837911c5932a0d14af4b145bece (diff)
Let calloc handle multiplication
It's going to multiply anyway, so if we have non-constant values, might as well let it do the multiplication instead of adding another multiply, and good versions of calloc will check for & avoid overflow in the process. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
Diffstat (limited to 'Xext')
-rw-r--r--Xext/panoramiXprocs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Xext/panoramiXprocs.c b/Xext/panoramiXprocs.c
index 413a66afb..5291a4a4b 100644
--- a/Xext/panoramiXprocs.c
+++ b/Xext/panoramiXprocs.c
@@ -1106,7 +1106,7 @@ PanoramiXCopyArea(ClientPtr client)
}
pitch = PixmapBytePad(stuff->width, drawables[0]->depth);
- if (!(data = calloc(1, stuff->height * pitch)))
+ if (!(data = calloc(stuff->height, pitch)))
return BadAlloc;
XineramaGetImageData(drawables, srcx, srcy,