summaryrefslogtreecommitdiff
path: root/mfb/mfbpixmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'mfb/mfbpixmap.c')
-rw-r--r--mfb/mfbpixmap.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/mfb/mfbpixmap.c b/mfb/mfbpixmap.c
index c3d5d5ea6..ad0dfe79f 100644
--- a/mfb/mfbpixmap.c
+++ b/mfb/mfbpixmap.c
@@ -75,12 +75,14 @@ mfbCreatePixmap (pScreen, width, height, depth)
int depth;
{
PixmapPtr pPixmap;
- int datasize;
- int paddedWidth;
+ size_t datasize;
+ size_t paddedWidth;
if (depth != 1)
return NullPixmap;
paddedWidth = BitmapBytePad(width);
+ if (paddedWidth / 4 > 32767 || height > 32767)
+ return NullPixmap;
datasize = height * paddedWidth;
pPixmap = AllocatePixmap(pScreen, datasize);
if (!pPixmap)