touch-input: Don't dereference NULL pointer during full screen fade
If a full screen program is fading out and a touch start happens, it
will result in a NULL pointer dereference when weston_touch_set_focus
tries to derefernce view->surface->resource.
Instead, this patch sets the focus to NULL, which should be the
same as if the program was destroyed during the touch anyway.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=78706
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
diff --git a/src/input.c b/src/input.c
index d03333a..5e82f5d 100644
--- a/src/input.c
+++ b/src/input.c
@@ -1471,8 +1471,14 @@
}
if (view) {
- struct wl_client *surface_client =
- wl_resource_get_client(view->surface->resource);
+ struct wl_client *surface_client;
+
+ if (!view->surface->resource) {
+ seat->touch->focus = NULL;
+ return;
+ }
+
+ surface_client = wl_resource_get_client(view->surface->resource);
move_resources_for_client(focus_resource_list,
&seat->touch->resource_list,
surface_client);