cairo-xcb-connection.c: fix undefined behavior in DEPTH_MASK

Bit-shifting a signed integer (which is what 1 is here) left is
undefined behavior – you can see it when compiling with
`-fsanitize=undefined`. Explicitly declaring 1 as unsigned fixes this.
This commit is contained in:
bandithedoge 2025-01-13 13:17:56 +01:00
parent 33173d9f1a
commit 6e0f760117

View file

@ -239,7 +239,7 @@ _cairo_xcb_connection_parse_xrender_formats (cairo_xcb_connection_t *connection,
/*
* We require support for depth 1, 8, 24 and 32 pixmaps
*/
#define DEPTH_MASK(d) (1 << ((d) - 1))
#define DEPTH_MASK(d) ((uint32_t)(1) << ((d) - 1))
#define REQUIRED_DEPTHS (DEPTH_MASK(1) | \
DEPTH_MASK(8) | \
DEPTH_MASK(24) | \