diff options
author | Heiko Lewin <hlewin@worldiety.de> | 2021-03-31 12:20:34 +0200 |
---|---|---|
committer | Heiko Lewin <hlewin@worldiety.de> | 2021-03-31 12:20:34 +0200 |
commit | 518ba137794243d1024634449a3e07f72b7b888e (patch) | |
tree | 3a891551b4e4074d3eee369a769be4702ba0bfd8 /src/cairo-png.c | |
parent | 44f808fce9f437e14f2b0ef4e1583def8ab578ae (diff) |
Fix undefined left-shifts
Diffstat (limited to 'src/cairo-png.c')
-rw-r--r-- | src/cairo-png.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cairo-png.c b/src/cairo-png.c index 0037dd531..f576047b1 100644 --- a/src/cairo-png.c +++ b/src/cairo-png.c @@ -595,7 +595,7 @@ premultiply_data (png_structp png, green = multiply_alpha (alpha, green); blue = multiply_alpha (alpha, blue); } - p = (alpha << 24) | (red << 16) | (green << 8) | (blue << 0); + p = ((uint32_t)alpha << 24) | (red << 16) | (green << 8) | (blue << 0); } memcpy (base, &p, sizeof (uint32_t)); } @@ -614,7 +614,7 @@ convert_bytes_to_data (png_structp png, png_row_infop row_info, png_bytep data) uint8_t blue = base[2]; uint32_t pixel; - pixel = (0xff << 24) | (red << 16) | (green << 8) | (blue << 0); + pixel = (0xffu << 24) | (red << 16) | (green << 8) | (blue << 0); memcpy (base, &pixel, sizeof (uint32_t)); } } |