@@ -2045,14 +2045,15 @@ ProcPutImage(ClientPtr client)
20452045{
20462046 GCPtr pGC ;
20472047 DrawablePtr pDraw ;
2048- long length ; /* length of scanline server padded */
2049- long lengthProto ; /* length of scanline protocol padded */
20502048 char * tmpImage ;
20512049
20522050 REQUEST (xPutImageReq );
20532051
20542052 REQUEST_AT_LEAST_SIZE (xPutImageReq );
20552053 VALIDATE_DRAWABLE_AND_GC (stuff -> drawable , pDraw , DixWriteAccess );
2054+
2055+ unsigned length ; /* length of scanline server padded */
2056+
20562057 if (stuff -> format == XYBitmap ) {
20572058 if ((stuff -> depth != 1 ) ||
20582059 (stuff -> leftPad >= (unsigned int ) screenInfo .bitmapScanlinePad ))
@@ -2077,7 +2078,7 @@ ProcPutImage(ClientPtr client)
20772078 }
20782079
20792080 tmpImage = (char * ) & stuff [1 ];
2080- lengthProto = length ;
2081+ size_t lengthProto = length ; /* length of scanline protocol padded */
20812082
20822083 if (stuff -> height != 0 && lengthProto >= (INT32_MAX / stuff -> height ))
20832084 return BadLength ;
@@ -2108,7 +2109,6 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
21082109
21092110 /* coordinates relative to the bounding drawable */
21102111 int relx , rely ;
2111- long widthBytesLine , length ;
21122112 Mask plane = 0 ;
21132113 RegionPtr pVisibleRegion = NULL ;
21142114
@@ -2178,6 +2178,8 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
21782178 return BadMatch ;
21792179
21802180 rep .depth = pDraw -> depth ;
2181+
2182+ size_t widthBytesLine , length ;
21812183 if (format == ZPixmap ) {
21822184 widthBytesLine = PixmapBytePad (width , pDraw -> depth );
21832185 length = widthBytesLine * height ;
@@ -2973,7 +2975,6 @@ ProcCreateCursor(ClientPtr client)
29732975 PixmapPtr msk ;
29742976 unsigned char * srcbits ;
29752977 unsigned short width , height ;
2976- long n ;
29772978 CursorMetricRec cm ;
29782979 int rc ;
29792980
@@ -3018,7 +3019,8 @@ ProcCreateCursor(ClientPtr client)
30183019 srcbits = calloc (BitmapBytePad (width ), height );
30193020 if (!srcbits )
30203021 return BadAlloc ;
3021- n = BitmapBytePad (width ) * height ;
3022+
3023+ size_t n = BitmapBytePad (width ) * height ;
30223024
30233025 unsigned char * mskbits = calloc (1 , n );
30243026 if (!mskbits ) {
0 commit comments