diff options
author | Carlos Olmedo Escobar <carlos.olmedo.e@gmail.com> | 2015-01-17 20:31:53 +0100 |
---|---|---|
committer | Bryce Harrington <bryce@osg.samsung.com> | 2015-01-23 12:45:58 -0800 |
commit | 50d4713e5bda1c9c59eb3121d5f7fae3f779daf6 (patch) | |
tree | fef5ffbde174ca533a6dbc3fd71f36c1a2524855 | |
parent | f44a9d862890ae19aa76815ad6435c0e8759ee5a (diff) |
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 <carlos.olmedo.e@gmail.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
-rw-r--r-- | src/zoom.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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); |