From 1a873aa9a0e800fb5dffe7f9c1cbae1d80f5503b Mon Sep 17 00:00:00 2001 From: Carlos Olmedo Escobar Date: Sat, 17 Jan 2015 20:31:53 +0100 Subject: [PATCH] zoom: Check the value of level before using it. Check the value of level before dividing 1 by it. Signed-off-by: Carlos Olmedo Escobar Reviewed-by: Derek Foreman Reviewed-by: Bryce Harrington --- src/zoom.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/zoom.c b/src/zoom.c index 7553849..f71d08c 100644 --- a/src/zoom.c +++ b/src/zoom.c @@ -120,12 +120,13 @@ weston_output_update_zoom_transform(struct weston_output *output) float ratio, level; level = output->zoom.spring_z.current; - ratio = 1 / level; if (!output->zoom.active || level > output->zoom.max_level || level == 0.0f) return; + ratio = 1 / level; + if (wl_list_empty(&output->zoom.animation_xy.link)) zoom_area_center_from_pointer(output, &x, &y); -- 2.7.4