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 <zhigang.gong@linux.intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit f4956faab9)
This commit is contained in:
Zhigang Gong 2012-01-04 07:01:19 +00:00 committed by Jeremy Huddleston
parent d2db5100b1
commit dea9377a25

View file

@ -648,7 +648,7 @@ miGetImage( DrawablePtr pDraw, int sx, int sy, int w, int h,
depth = pDraw->depth; depth = pDraw->depth;
if(format == ZPixmap) if(format == ZPixmap)
{ {
if ( (((1<<depth)-1)&planeMask) != (1<<depth)-1 ) if ( (((1LL<<depth)-1)&planeMask) != (1LL<<depth)-1 )
{ {
ChangeGCVal gcv; ChangeGCVal gcv;
xPoint pt; xPoint pt;