summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Ådahl <jadahl@gmail.com>2016-04-21 10:21:48 +0800
committerJonas Ådahl <jadahl@gmail.com>2016-04-22 10:31:28 +0800
commited6014a9e481772580f7eb9fc7a1200aca7aec5c (patch)
treeff72bc3fa3dbabe1306b03a28b56a6504bdfad17
parent8b6c9fcd4e471c0ca003877e58ac981461f9ae23 (diff)
input: Don't try to send axis_source when there are no resources
The focus_client pointer may be NULL here if the focused client has no pointer resources. To avoid a crash, NULL check focus client before proceeding to send the events. https://bugs.freedesktop.org/show_bug.cgi?id=94899 Signed-off-by: Jonas Ådahl <jadahl@gmail.com> Reviewed-by: Mike Blumenkrantz <zmike@osg.samsung.com>
-rw-r--r--src/input.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/input.c b/src/input.c
index c881792d..8fe898c6 100644
--- a/src/input.c
+++ b/src/input.c
@@ -367,6 +367,9 @@ weston_pointer_send_axis_source(struct weston_pointer *pointer, uint32_t source)
struct wl_resource *resource;
struct wl_list *resource_list;
+ if (!pointer->focus_client)
+ return;
+
resource_list = &pointer->focus_client->pointer_resources;
wl_resource_for_each(resource, resource_list) {
if (wl_resource_get_version(resource) >=