From f8c65e72e3059d43343106e700dbdad824fd61e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Wed, 22 Nov 2017 09:35:20 +0000 Subject: [PATCH] ofz#4372 ubsan: Undefined-shift in color_to_uint32 pixman-solid-fill.c:33 runtime error: left shift of 255 by 24 places cannot be represented in type 'int' --- pixman/pixman-solid-fill.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pixman/pixman-solid-fill.c b/pixman/pixman-solid-fill.c index 5f9fef6..e6e9ce6 100644 --- a/pixman/pixman-solid-fill.c +++ b/pixman/pixman-solid-fill.c @@ -30,10 +30,10 @@ static uint32_t color_to_uint32 (const pixman_color_t *color) { return - (color->alpha >> 8 << 24) | - (color->red >> 8 << 16) | + ((uint32_t)color->alpha >> 8 << 24) | + ((uint32_t)color->red >> 8 << 16) | (color->green & 0xff00) | - (color->blue >> 8); + ((uint32_t)color->blue >> 8); } static argb_t -- 2.9.5