From be698b597b53527c3d873b293c9c12113bfb582d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Sun, 12 Jan 2014 19:36:28 +0100 Subject: [PATCH] shaped-texture: Use a double when calculating clip MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For x defined below, x == -INT32_MAX assuming that the arithmetic expression actually uses the fpu. float f = 1.0f; int32_t x = INT32_MAX * f; This would result in the calculated clip width/height to be -INT_MAX if the damage width/height is INT_MAX. To solve this, use a double variable instead. Signed-off-by: Jonas Ã…dahl https://bugzilla.gnome.org/show_bug.cgi?id=705502 --- src/compositor/meta-shaped-texture.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compositor/meta-shaped-texture.c b/src/compositor/meta-shaped-texture.c index b37770e4e..293958438 100644 --- a/src/compositor/meta-shaped-texture.c +++ b/src/compositor/meta-shaped-texture.c @@ -605,8 +605,8 @@ get_clip (MetaShapedTexture *stex, ClutterActor *self = CLUTTER_ACTOR (stex); MetaShapedTexturePrivate *priv; ClutterActorBox allocation; - float scale_x; - float scale_y; + double scale_x; + double scale_y; /* NB: clutter_actor_queue_redraw_with_clip expects a box in the actor's * coordinate space so we need to convert from surface coordinates to