@@ -2153,14 +2153,15 @@ ProcPutImage(ClientPtr client)
21532153{
21542154 GCPtr pGC ;
21552155 DrawablePtr pDraw ;
2156- long length ; /* length of scanline server padded */
2157- long lengthProto ; /* length of scanline protocol padded */
21582156 char * tmpImage ;
21592157
21602158 REQUEST (xPutImageReq );
21612159
21622160 REQUEST_AT_LEAST_SIZE (xPutImageReq );
21632161 VALIDATE_DRAWABLE_AND_GC (stuff -> drawable , pDraw , DixWriteAccess );
2162+
2163+ unsigned length ; /* length of scanline server padded */
2164+
21642165 if (stuff -> format == XYBitmap ) {
21652166 if ((stuff -> depth != 1 ) ||
21662167 (stuff -> leftPad >= (unsigned int ) screenInfo .bitmapScanlinePad ))
@@ -2185,7 +2186,7 @@ ProcPutImage(ClientPtr client)
21852186 }
21862187
21872188 tmpImage = (char * ) & stuff [1 ];
2188- lengthProto = length ;
2189+ size_t lengthProto = length ; /* length of scanline protocol padded */
21892190
21902191 if (stuff -> height != 0 && lengthProto >= (INT32_MAX / stuff -> height ))
21912192 return BadLength ;
@@ -2216,7 +2217,6 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
22162217
22172218 /* coordinates relative to the bounding drawable */
22182219 int relx , rely ;
2219- long widthBytesLine , length ;
22202220 Mask plane = 0 ;
22212221 RegionPtr pVisibleRegion = NULL ;
22222222
@@ -2286,6 +2286,8 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
22862286 return BadMatch ;
22872287
22882288 rep .depth = pDraw -> depth ;
2289+
2290+ size_t widthBytesLine , length ;
22892291 if (format == ZPixmap ) {
22902292 widthBytesLine = PixmapBytePad (width , pDraw -> depth );
22912293 length = widthBytesLine * height ;
@@ -3074,7 +3076,6 @@ ProcCreateCursor(ClientPtr client)
30743076 PixmapPtr msk ;
30753077 unsigned char * srcbits ;
30763078 unsigned short width , height ;
3077- long n ;
30783079 CursorMetricRec cm ;
30793080 int rc ;
30803081
@@ -3119,7 +3120,8 @@ ProcCreateCursor(ClientPtr client)
31193120 srcbits = calloc (BitmapBytePad (width ), height );
31203121 if (!srcbits )
31213122 return BadAlloc ;
3122- n = BitmapBytePad (width ) * height ;
3123+
3124+ size_t n = BitmapBytePad (width ) * height ;
31233125
31243126 unsigned char * mskbits = calloc (1 , n );
31253127 if (!mskbits ) {
0 commit comments