@@ -2054,14 +2054,15 @@ ProcPutImage(ClientPtr client)
20542054{
20552055 GCPtr pGC ;
20562056 DrawablePtr pDraw ;
2057- long length ; /* length of scanline server padded */
2058- long lengthProto ; /* length of scanline protocol padded */
20592057 char * tmpImage ;
20602058
20612059 REQUEST (xPutImageReq );
20622060
20632061 REQUEST_AT_LEAST_SIZE (xPutImageReq );
20642062 VALIDATE_DRAWABLE_AND_GC (stuff -> drawable , pDraw , DixWriteAccess );
2063+
2064+ unsigned length ; /* length of scanline server padded */
2065+
20652066 if (stuff -> format == XYBitmap ) {
20662067 if ((stuff -> depth != 1 ) ||
20672068 (stuff -> leftPad >= (unsigned int ) screenInfo .bitmapScanlinePad ))
@@ -2086,7 +2087,7 @@ ProcPutImage(ClientPtr client)
20862087 }
20872088
20882089 tmpImage = (char * ) & stuff [1 ];
2089- lengthProto = length ;
2090+ size_t lengthProto = length ; /* length of scanline protocol padded */
20902091
20912092 if (stuff -> height != 0 && lengthProto >= (INT32_MAX / stuff -> height ))
20922093 return BadLength ;
@@ -2117,7 +2118,6 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
21172118
21182119 /* coordinates relative to the bounding drawable */
21192120 int relx , rely ;
2120- long widthBytesLine , length ;
21212121 Mask plane = 0 ;
21222122 RegionPtr pVisibleRegion = NULL ;
21232123
@@ -2187,6 +2187,8 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
21872187 return BadMatch ;
21882188
21892189 rep .depth = pDraw -> depth ;
2190+
2191+ size_t widthBytesLine , length ;
21902192 if (format == ZPixmap ) {
21912193 widthBytesLine = PixmapBytePad (width , pDraw -> depth );
21922194 length = widthBytesLine * height ;
@@ -2986,7 +2988,6 @@ ProcCreateCursor(ClientPtr client)
29862988 PixmapPtr msk ;
29872989 unsigned char * srcbits ;
29882990 unsigned short width , height ;
2989- long n ;
29902991 CursorMetricRec cm ;
29912992 int rc ;
29922993
@@ -3031,7 +3032,8 @@ ProcCreateCursor(ClientPtr client)
30313032 srcbits = calloc (BitmapBytePad (width ), height );
30323033 if (!srcbits )
30333034 return BadAlloc ;
3034- n = BitmapBytePad (width ) * height ;
3035+
3036+ size_t n = BitmapBytePad (width ) * height ;
30353037
30363038 unsigned char * mskbits = calloc (1 , n );
30373039 if (!mskbits ) {
0 commit comments