input: Fix crash when touchscreen generates out of screen coordinate
With change 61ed7b6b, global touch coordinates are being passed to the
touch grab. However, touch->grab is undefined in certain circumstances
such as when the touch screen raises an axis X value larger than the
maximum expected. Move the check for this condition earlier, before our
first use of the pointer.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=92736
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
This commit is contained in:
+4
-1
@@ -446,11 +446,14 @@ default_grab_touch_down(struct weston_touch_grab *grab, uint32_t time,
|
|||||||
struct wl_list *resource_list;
|
struct wl_list *resource_list;
|
||||||
wl_fixed_t sx, sy;
|
wl_fixed_t sx, sy;
|
||||||
|
|
||||||
|
if (!touch->focus)
|
||||||
|
return;
|
||||||
|
|
||||||
weston_view_from_global_fixed(touch->focus, x, y, &sx, &sy);
|
weston_view_from_global_fixed(touch->focus, x, y, &sx, &sy);
|
||||||
|
|
||||||
resource_list = &touch->focus_resource_list;
|
resource_list = &touch->focus_resource_list;
|
||||||
|
|
||||||
if (!wl_list_empty(resource_list) && touch->focus) {
|
if (!wl_list_empty(resource_list)) {
|
||||||
serial = wl_display_next_serial(display);
|
serial = wl_display_next_serial(display);
|
||||||
wl_resource_for_each(resource, resource_list)
|
wl_resource_for_each(resource, resource_list)
|
||||||
wl_touch_send_down(resource, serial, time,
|
wl_touch_send_down(resource, serial, time,
|
||||||
|
|||||||
Reference in New Issue
Block a user