From 6a8192b6dd88b833bb918de28331d3a85c84a4f7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=B8ren=20Sandmann=20Pedersen?= Date: Tue, 20 Dec 2011 06:34:41 -0500 Subject: [PATCH] In MUL_UNc() cast to comp2_t Otherwise, when comp1_t is 16 bits wide, we can end up with a signed integer overflow. --- pixman/pixman-combine.h.template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pixman/pixman-combine.h.template b/pixman/pixman-combine.h.template index 67ed309..53afcd2 100644 --- a/pixman/pixman-combine.h.template +++ b/pixman/pixman-combine.h.template @@ -25,7 +25,7 @@ */ #define MUL_UNc(a, b, t) \ - ((t) = (a) * (b) + ONE_HALF, ((((t) >> G_SHIFT ) + (t) ) >> G_SHIFT )) + ((t) = (a) * (comp2_t)(b) + ONE_HALF, ((((t) >> G_SHIFT ) + (t) ) >> G_SHIFT )) #define DIV_UNc(a, b) \ (((comp2_t) (a) * MASK) / (b)) -- 2.7.4