mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2025-12-20 07:00:09 +01:00
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>
This commit is contained in:
parent
f44a9d8628
commit
50d4713e5b
1 changed files with 2 additions and 1 deletions
|
|
@ -120,12 +120,13 @@ weston_output_update_zoom_transform(struct weston_output *output)
|
||||||
float ratio, level;
|
float ratio, level;
|
||||||
|
|
||||||
level = output->zoom.spring_z.current;
|
level = output->zoom.spring_z.current;
|
||||||
ratio = 1 / level;
|
|
||||||
|
|
||||||
if (!output->zoom.active || level > output->zoom.max_level ||
|
if (!output->zoom.active || level > output->zoom.max_level ||
|
||||||
level == 0.0f)
|
level == 0.0f)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
ratio = 1 / level;
|
||||||
|
|
||||||
if (wl_list_empty(&output->zoom.animation_xy.link))
|
if (wl_list_empty(&output->zoom.animation_xy.link))
|
||||||
zoom_area_center_from_pointer(output, &x, &y);
|
zoom_area_center_from_pointer(output, &x, &y);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue