aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/mi/mibitblt.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/mi/mibitblt.c')
-rw-r--r--xorg-server/mi/mibitblt.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/xorg-server/mi/mibitblt.c b/xorg-server/mi/mibitblt.c
index 724396333..28296a449 100644
--- a/xorg-server/mi/mibitblt.c
+++ b/xorg-server/mi/mibitblt.c
@@ -136,11 +136,11 @@ miCopyArea(DrawablePtr pSrcDrawable,
dsty += pDstDrawable->y;
}
- pptFirst = ppt = malloc(heightSrc * sizeof(DDXPointRec));
- pwidthFirst = pwidth = malloc(heightSrc * sizeof(unsigned int));
+ pptFirst = ppt = xallocarray(heightSrc, sizeof(DDXPointRec));
+ pwidthFirst = pwidth = xallocarray(heightSrc, sizeof(unsigned int));
numRects = RegionNumRects(prgnSrcClip);
boxes = RegionRects(prgnSrcClip);
- ordering = malloc(numRects * sizeof(unsigned int));
+ ordering = xallocarray(numRects, sizeof(unsigned int));
if (!pptFirst || !pwidthFirst || !ordering) {
free(ordering);
free(pwidthFirst);
@@ -221,7 +221,7 @@ miCopyArea(DrawablePtr pSrcDrawable,
ppt++->y = y++;
*pwidth++ = width;
}
- pbits = malloc(height * PixmapBytePad(width, pSrcDrawable->depth));
+ pbits = xallocarray(height, PixmapBytePad(width, pSrcDrawable->depth));
if (pbits) {
(*pSrcDrawable->pScreen->GetSpans) (pSrcDrawable, width, pptFirst,
(int *) pwidthFirst, height,
@@ -398,8 +398,8 @@ miOpqStipDrawable(DrawablePtr pDraw, GCPtr pGC, RegionPtr prgnSrc,
ChangeGC(NullClient, pGCT, GCBackground, gcv);
ValidateGC((DrawablePtr) pPixmap, pGCT);
miClearDrawable((DrawablePtr) pPixmap, pGCT);
- ppt = pptFirst = malloc(h * sizeof(DDXPointRec));
- pwidth = pwidthFirst = malloc(h * sizeof(int));
+ ppt = pptFirst = xallocarray(h, sizeof(DDXPointRec));
+ pwidth = pwidthFirst = xallocarray(h, sizeof(int));
if (!pptFirst || !pwidthFirst) {
free(pwidthFirst);
free(pptFirst);
@@ -746,8 +746,8 @@ miPutImage(DrawablePtr pDraw, GCPtr pGC, int depth,
break;
case ZPixmap:
- ppt = pptFirst = malloc(h * sizeof(DDXPointRec));
- pwidth = pwidthFirst = malloc(h * sizeof(int));
+ ppt = pptFirst = xallocarray(h, sizeof(DDXPointRec));
+ pwidth = pwidthFirst = xallocarray(h, sizeof(int));
if (!pptFirst || !pwidthFirst) {
free(pwidthFirst);
free(pptFirst);