From c3244d7abc7e417363898d3d4e852ef3aee63125 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Thu, 24 Oct 2013 14:21:53 -0700 Subject: [PATCH] input: Properly handle setting touch focus to NULL This happens on TOUCH_UP, and we unconditionally dereference view->surface. --- src/input.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/input.c b/src/input.c index 2fed718f..49788b2a 100644 --- a/src/input.c +++ b/src/input.c @@ -1154,7 +1154,8 @@ weston_touch_set_focus(struct weston_seat *seat, struct weston_view *view) focus_resource_list = &seat->touch->focus_resource_list; - if (seat->touch->focus->surface == view->surface) { + if (view && seat->touch->focus && + seat->touch->focus->surface == view->surface) { seat->touch->focus = view; return; }