diff options
author | Jonas Ådahl <jadahl@gmail.com> | 2017-12-11 18:22:21 +0800 |
---|---|---|
committer | Jonas Ådahl <jadahl@gmail.com> | 2018-01-12 18:57:43 +0800 |
commit | 4e3b26d2ed2c51acac35a115946f6f3aa79e3f3e (patch) | |
tree | 1730fe790ba36c637b4aa3c7269a3ab7bf3ec5b2 /clutter | |
parent | 5f05112b9a66d6e12877d15db589acf4624ce4a6 (diff) | |
download | mutter-4e3b26d2ed2c51acac35a115946f6f3aa79e3f3e.tar.gz |
clutter/evdev: Ignore unknown touch points
We might receive touch events for unknown touch points, for example
when starting mutter while touching the screen (resulting in no
touch-down event ever being received). Avoid crashing when this happens
by just dropping these events on the floor.
https://bugzilla.gnome.org/show_bug.cgi?id=791371
Diffstat (limited to 'clutter')
-rw-r--r-- | clutter/clutter/evdev/clutter-device-manager-evdev.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clutter/clutter/evdev/clutter-device-manager-evdev.c b/clutter/clutter/evdev/clutter-device-manager-evdev.c index 44e3dddbb..d00c771b2 100644 --- a/clutter/clutter/evdev/clutter-device-manager-evdev.c +++ b/clutter/clutter/evdev/clutter-device-manager-evdev.c @@ -1459,6 +1459,8 @@ process_device_event (ClutterDeviceManagerEvdev *manager_evdev, slot = libinput_event_touch_get_slot (touch_event); time_us = libinput_event_touch_get_time_usec (touch_event); touch_state = clutter_seat_evdev_get_touch (seat, slot); + if (!touch_state) + break; notify_touch_event (device, CLUTTER_TOUCH_END, time_us, slot, touch_state->coords.x, touch_state->coords.y); @@ -1497,6 +1499,9 @@ process_device_event (ClutterDeviceManagerEvdev *manager_evdev, stage_height); touch_state = clutter_seat_evdev_get_touch (seat, slot); + if (!touch_state) + break; + touch_state->coords.x = x; touch_state->coords.y = y; |