diff options
author | Dudemanguy911 <random342@airmail.cc> | 2019-09-21 10:38:43 -0500 |
---|---|---|
committer | Dudemanguy911 <random342@airmail.cc> | 2019-09-21 10:38:43 -0500 |
commit | 685e927fbe5d300ba20c5a6c4bdc36aa38a6f85d (patch) | |
tree | 8f34a1d170baa7f6f4833e701bc2a740a99e7937 /video/out/wayland_common.c | |
parent | 6111f57ef9269b46e19ca6f1f20c8b61f2ea7a6b (diff) | |
download | mpv-685e927fbe5d300ba20c5a6c4bdc36aa38a6f85d.tar.bz2 mpv-685e927fbe5d300ba20c5a6c4bdc36aa38a6f85d.tar.xz |
wayland: avoid handling a 0-value axis event
This shouldn't be possible, but an extra check never hurts.
Diffstat (limited to 'video/out/wayland_common.c')
-rw-r--r-- | video/out/wayland_common.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index 5af8abdb19..30c1d3bf8f 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -189,6 +189,8 @@ static void pointer_handle_axis(void *data, struct wl_pointer *wl_pointer, uint32_t time, uint32_t axis, wl_fixed_t value) { struct vo_wayland_state *wl = data; + if (wl_fixed_to_double(value) == 0) + return; double val = wl_fixed_to_double(value)/abs(wl_fixed_to_double(value)); switch (axis) { case WL_POINTER_AXIS_VERTICAL_SCROLL: |