@@ -2040,14 +2040,15 @@ ProcPutImage(ClientPtr client)
20402040{
20412041 GCPtr pGC ;
20422042 DrawablePtr pDraw ;
2043- long length ; /* length of scanline server padded */
2044- long lengthProto ; /* length of scanline protocol padded */
20452043 char * tmpImage ;
20462044
20472045 REQUEST (xPutImageReq );
20482046
20492047 REQUEST_AT_LEAST_SIZE (xPutImageReq );
20502048 VALIDATE_DRAWABLE_AND_GC (stuff -> drawable , pDraw , DixWriteAccess );
2049+
2050+ unsigned length ; /* length of scanline server padded */
2051+
20512052 if (stuff -> format == XYBitmap ) {
20522053 if ((stuff -> depth != 1 ) ||
20532054 (stuff -> leftPad >= (unsigned int ) screenInfo .bitmapScanlinePad ))
@@ -2072,7 +2073,7 @@ ProcPutImage(ClientPtr client)
20722073 }
20732074
20742075 tmpImage = (char * ) & stuff [1 ];
2075- lengthProto = length ;
2076+ size_t lengthProto = length ; /* length of scanline protocol padded */
20762077
20772078 if (stuff -> height != 0 && lengthProto >= (INT32_MAX / stuff -> height ))
20782079 return BadLength ;
@@ -2103,7 +2104,6 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
21032104
21042105 /* coordinates relative to the bounding drawable */
21052106 int relx , rely ;
2106- long widthBytesLine , length ;
21072107 Mask plane = 0 ;
21082108 RegionPtr pVisibleRegion = NULL ;
21092109
@@ -2173,6 +2173,8 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
21732173 return BadMatch ;
21742174
21752175 rep .depth = pDraw -> depth ;
2176+
2177+ size_t widthBytesLine , length ;
21762178 if (format == ZPixmap ) {
21772179 widthBytesLine = PixmapBytePad (width , pDraw -> depth );
21782180 length = widthBytesLine * height ;
@@ -2972,7 +2974,6 @@ ProcCreateCursor(ClientPtr client)
29722974 PixmapPtr msk ;
29732975 unsigned char * srcbits ;
29742976 unsigned short width , height ;
2975- long n ;
29762977 CursorMetricRec cm ;
29772978 int rc ;
29782979
@@ -3017,7 +3018,8 @@ ProcCreateCursor(ClientPtr client)
30173018 srcbits = calloc (BitmapBytePad (width ), height );
30183019 if (!srcbits )
30193020 return BadAlloc ;
3020- n = BitmapBytePad (width ) * height ;
3021+
3022+ size_t n = BitmapBytePad (width ) * height ;
30213023
30223024 unsigned char * mskbits = calloc (1 , n );
30233025 if (!mskbits ) {
0 commit comments