summaryrefslogtreecommitdiff
path: root/dix/pixmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'dix/pixmap.c')
-rw-r--r--dix/pixmap.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/dix/pixmap.c b/dix/pixmap.c
index f76c557f4..78ce2a8c6 100644
--- a/dix/pixmap.c
+++ b/dix/pixmap.c
@@ -118,6 +118,9 @@ AllocatePixmap(ScreenPtr pScreen, int pixDataSize)
unsigned size;
int i;
+ if (pScreen->totalPixmapSize > ((size_t)-1) - pixDataSize)
+ return NullPixmap;
+
pPixmap = (PixmapPtr)xalloc(pScreen->totalPixmapSize + pixDataSize);
if (!pPixmap)
return NullPixmap;