mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-02-21 08:40:38 +01:00
Avoid shifting 32-bit quanity by 32 bits, which is undefined behavior.
This commit is contained in:
parent
0c05b23b31
commit
f67f5003df
2 changed files with 8 additions and 2 deletions
|
|
@ -1,3 +1,8 @@
|
|||
2005-05-17 Carl Worth <cworth@cworth.org>
|
||||
|
||||
* src/cairo-xlib-surface.c (_get_image_surface): Avoid shifting
|
||||
32-bit quanity by 32 bits, which is undefined behavior.
|
||||
|
||||
2005-05-17 Carl Worth <cworth@cworth.org>
|
||||
|
||||
Rework of cairo_xlib_surface create functions by Keith Packard:
|
||||
|
|
|
|||
|
|
@ -385,9 +385,10 @@ _get_image_surface (cairo_xlib_surface_t *surface,
|
|||
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))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue