@@ -2111,14 +2111,15 @@ ProcPutImage(ClientPtr client)
21112111{
21122112 GCPtr pGC ;
21132113 DrawablePtr pDraw ;
2114- long length ; /* length of scanline server padded */
2115- long lengthProto ; /* length of scanline protocol padded */
21162114 char * tmpImage ;
21172115
21182116 REQUEST (xPutImageReq );
21192117
21202118 REQUEST_AT_LEAST_SIZE (xPutImageReq );
21212119 VALIDATE_DRAWABLE_AND_GC (stuff -> drawable , pDraw , DixWriteAccess );
2120+
2121+ unsigned length ; /* length of scanline server padded */
2122+
21222123 if (stuff -> format == XYBitmap ) {
21232124 if ((stuff -> depth != 1 ) ||
21242125 (stuff -> leftPad >= (unsigned int ) screenInfo .bitmapScanlinePad ))
@@ -2143,7 +2144,7 @@ ProcPutImage(ClientPtr client)
21432144 }
21442145
21452146 tmpImage = (char * ) & stuff [1 ];
2146- lengthProto = length ;
2147+ size_t lengthProto = length ; /* length of scanline protocol padded */
21472148
21482149 if (stuff -> height != 0 && lengthProto >= (INT32_MAX / stuff -> height ))
21492150 return BadLength ;
@@ -2174,7 +2175,6 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
21742175
21752176 /* coordinates relative to the bounding drawable */
21762177 int relx , rely ;
2177- long widthBytesLine , length ;
21782178 Mask plane = 0 ;
21792179 RegionPtr pVisibleRegion = NULL ;
21802180
@@ -2244,6 +2244,8 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
22442244 return BadMatch ;
22452245
22462246 rep .depth = pDraw -> depth ;
2247+
2248+ size_t widthBytesLine , length ;
22472249 if (format == ZPixmap ) {
22482250 widthBytesLine = PixmapBytePad (width , pDraw -> depth );
22492251 length = widthBytesLine * height ;
@@ -3032,7 +3034,6 @@ ProcCreateCursor(ClientPtr client)
30323034 PixmapPtr msk ;
30333035 unsigned char * srcbits ;
30343036 unsigned short width , height ;
3035- long n ;
30363037 CursorMetricRec cm ;
30373038 int rc ;
30383039
@@ -3077,7 +3078,8 @@ ProcCreateCursor(ClientPtr client)
30773078 srcbits = calloc (BitmapBytePad (width ), height );
30783079 if (!srcbits )
30793080 return BadAlloc ;
3080- n = BitmapBytePad (width ) * height ;
3081+
3082+ size_t n = BitmapBytePad (width ) * height ;
30813083
30823084 unsigned char * mskbits = calloc (1 , n );
30833085 if (!mskbits ) {
0 commit comments