[cairo-commit] cairo/src cairo-xlib-surface.c,1.69,1.70

Carl Worth commit at pdx.freedesktop.org
Tue May 17 06:08:03 PDT 2005


Committed by: cworth

Update of /cvs/cairo/cairo/src
In directory gabe:/tmp/cvs-serv22383/src

Modified Files:
	cairo-xlib-surface.c 
Log Message:

        * src/cairo-xlib-surface.c (_get_image_surface): Avoid shifting
        32-bit quanity by 32 bits, which is undefined behavior.


Index: cairo-xlib-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-xlib-surface.c,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -d -r1.69 -r1.70
--- cairo-xlib-surface.c	17 May 2005 13:05:13 -0000	1.69
+++ cairo-xlib-surface.c	17 May 2005 13:08:01 -0000	1.70
@@ -385,9 +385,10 @@
 	masks.red_mask = 0;
 	masks.green_mask = 0;
 	masks.blue_mask = 0;
-	masks.alpha_mask = (1 << surface->depth) - 1;
-	if (!masks.alpha_mask)
+	if (surface->depth == 32)
 	    masks.alpha_mask = 0xffffffff;
+	else
+	    masks.alpha_mask = (1 << surface->depth) - 1;
     }
 
     if (_CAIRO_MASK_FORMAT (&masks, &format))




More information about the cairo-commit mailing list