From 5f8bd1d160c67564c9b31dfcf769f9fa91b051ec Mon Sep 17 00:00:00 2001 From: Tomas Frydrych Date: Mon, 11 Jun 2007 15:47:26 +0000 Subject: [PATCH] Fixed unsigned overflow in sine alpha functions --- ChangeLog | 8 ++++++++ clutter/clutter-alpha.c | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 07aa1c1cc..87b69ff1c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-06-11 Tomas Frydrych + + * clutter/clutter-alpha.c: + (clutter_alpha_sine_inc): + (clutter_alpha_sine_dec): + (clutter_alpha_sine_half): + Fixed unsigned overflow. + 2007-06-11 Emmanuele Bassi * clutter/clutter-event.h: Add full modifier masks enums. diff --git a/clutter/clutter-alpha.c b/clutter/clutter-alpha.c index 9850984b8..392d2cdf9 100644 --- a/clutter/clutter-alpha.c +++ b/clutter/clutter-alpha.c @@ -629,7 +629,7 @@ clutter_sine_inc_func (ClutterAlpha *alpha, sine = clutter_sini (x) * CLUTTER_ALPHA_MAX_ALPHA; - return CFX_INT (sine); + return ((guint32)sine) >> CFX_Q; } /** @@ -663,7 +663,7 @@ clutter_sine_dec_func (ClutterAlpha *alpha, sine = clutter_sini (x) * CLUTTER_ALPHA_MAX_ALPHA; - return CFX_INT (sine); + return ((guint32)sine) >> CFX_Q; } /** @@ -697,7 +697,7 @@ clutter_sine_half_func (ClutterAlpha *alpha, sine = clutter_sini (x) * CLUTTER_ALPHA_MAX_ALPHA; - return CFX_INT (sine); + return ((guint32)sine) >> CFX_Q; } /**