@@ -2162,14 +2162,15 @@ ProcPutImage(ClientPtr client)
21622162{
21632163 GCPtr pGC ;
21642164 DrawablePtr pDraw ;
2165- long length ; /* length of scanline server padded */
2166- long lengthProto ; /* length of scanline protocol padded */
21672165 char * tmpImage ;
21682166
21692167 REQUEST (xPutImageReq );
21702168
21712169 REQUEST_AT_LEAST_SIZE (xPutImageReq );
21722170 VALIDATE_DRAWABLE_AND_GC (stuff -> drawable , pDraw , DixWriteAccess );
2171+
2172+ size_t length ; /* length of scanline server padded */
2173+
21732174 if (stuff -> format == XYBitmap ) {
21742175 if ((stuff -> depth != 1 ) ||
21752176 (stuff -> leftPad >= (unsigned int ) screenInfo .bitmapScanlinePad ))
@@ -2194,7 +2195,7 @@ ProcPutImage(ClientPtr client)
21942195 }
21952196
21962197 tmpImage = (char * ) & stuff [1 ];
2197- lengthProto = length ;
2198+ size_t lengthProto = length ; /* length of scanline protocol padded */
21982199
21992200 if (stuff -> height != 0 && lengthProto >= (INT32_MAX / stuff -> height ))
22002201 return BadLength ;
@@ -2225,7 +2226,6 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
22252226
22262227 /* coordinates relative to the bounding drawable */
22272228 int relx , rely ;
2228- long widthBytesLine , length ;
22292229 Mask plane = 0 ;
22302230 RegionPtr pVisibleRegion = NULL ;
22312231
@@ -2295,6 +2295,8 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
22952295 return BadMatch ;
22962296
22972297 rep .depth = pDraw -> depth ;
2298+
2299+ size_t widthBytesLine , length ;
22982300 if (format == ZPixmap ) {
22992301 widthBytesLine = PixmapBytePad (width , pDraw -> depth );
23002302 length = widthBytesLine * height ;
@@ -3092,7 +3094,6 @@ ProcCreateCursor(ClientPtr client)
30923094 PixmapPtr msk ;
30933095 unsigned char * srcbits ;
30943096 unsigned short width , height ;
3095- long n ;
30963097 CursorMetricRec cm ;
30973098 int rc ;
30983099
@@ -3137,7 +3138,8 @@ ProcCreateCursor(ClientPtr client)
31373138 srcbits = calloc (BitmapBytePad (width ), height );
31383139 if (!srcbits )
31393140 return BadAlloc ;
3140- n = BitmapBytePad (width ) * height ;
3141+
3142+ size_t n = BitmapBytePad (width ) * height ;
31413143
31423144 unsigned char * mskbits = calloc (1 , n );
31433145 if (!mskbits ) {
0 commit comments