diff options
author | Søren Sandmann Pedersen <ssp@redhat.com> | 2011-12-20 06:34:41 -0500 |
---|---|---|
committer | Søren Sandmann Pedersen <ssp@redhat.com> | 2012-01-09 05:40:33 -0500 |
commit | 6a8192b6dd88b833bb918de28331d3a85c84a4f7 (patch) | |
tree | 6387fec8be7ec961582a554e23e1c752b3208101 | |
parent | 33ac0a9084aabd0e47fb1c9e5638eafc809c52cb (diff) |
In MUL_UNc() cast to comp2_t
Otherwise, when comp1_t is 16 bits wide, we can end up with a signed
integer overflow.
-rw-r--r-- | pixman/pixman-combine.h.template | 2 |
1 files changed, 1 insertions, 1 deletions
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)) |