mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
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>
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user