[PATCH] mi/mibitblt: Fix an overflow bug of bit shift.

zhigang.gong at linux.intel.com zhigang.gong at linux.intel.com
Tue Jan 3 23:01:19 PST 2012


From: Zhigang Gong <zhigang.gong at linux.intel.com>

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 at linux.intel.com>
---
 mi/mibitblt.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/mi/mibitblt.c b/mi/mibitblt.c
index 2dfff14..fc6eb8d 100644
--- a/mi/mibitblt.c
+++ b/mi/mibitblt.c
@@ -648,7 +648,7 @@ miGetImage( DrawablePtr pDraw, int sx, int sy, int w, int h,
     depth = pDraw->depth;
     if(format == ZPixmap)
     {
-	if ( (((1<<depth)-1)&planeMask) != (1<<depth)-1 )
+	if ( (((1LL<<depth)-1)&planeMask) != (1LL<<depth)-1 )
 	{
 	    ChangeGCVal gcv;
 	    xPoint pt;
-- 
1.7.4.4



More information about the xorg-devel mailing list