Skip to content

Commit dea9377

Browse files
Zhigang Gongjeremyhu
Zhigang Gong
authored andcommitted
mi/mibitblt: Fix an overflow bug of bit shift.
When depth equal to 32 and planeMask equal to 0, the overflow will occur and cause the pixmap can't be cleared. There are some test cases in XTS hit this bug, and this fix can eliminate the corresponding failures. Signed-off-by: Zhigang Gong <[email protected]> Reviewed-by: Adam Jackson <[email protected]> Signed-off-by: Keith Packard <[email protected]> (cherry picked from commit f4956fa)
1 parent d2db510 commit dea9377

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mi/mibitblt.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ miGetImage( DrawablePtr pDraw, int sx, int sy, int w, int h,
648648
depth = pDraw->depth;
649649
if(format == ZPixmap)
650650
{
651-
if ( (((1<<depth)-1)&planeMask) != (1<<depth)-1 )
651+
if ( (((1LL<<depth)-1)&planeMask) != (1LL<<depth)-1 )
652652
{
653653
ChangeGCVal gcv;
654654
xPoint pt;

0 commit comments

Comments
 (0)