diff --git a/dix/gestures.c b/dix/gestures.c index 6b0f24728..4889a145a 100644 --- a/dix/gestures.c +++ b/dix/gestures.c @@ -234,6 +234,7 @@ GestureAddRegularListener(DeviceIntPtr dev, GestureInfoPtr gi, WindowPtr win, In return; inputMasks = wOtherInputMasks(win); + BUG_RETURN(!inputMasks); if (mask & EVENT_XI2_MASK) { nt_list_for_each_entry(iclients, inputMasks->inputClients, next) { diff --git a/dix/touch.c b/dix/touch.c index 7c509fb26..749454637 100644 --- a/dix/touch.c +++ b/dix/touch.c @@ -760,6 +760,8 @@ TouchAddRegularListener(DeviceIntPtr dev, TouchPointInfoPtr ti, inputMasks = wOtherInputMasks(win); if (mask & EVENT_XI2_MASK) { + BUG_RETURN_VAL(!inputMasks, FALSE); + nt_list_for_each_entry(iclients, inputMasks->inputClients, next) { if (!xi2mask_isset(iclients->xi2mask, dev, evtype)) continue; @@ -777,6 +779,8 @@ TouchAddRegularListener(DeviceIntPtr dev, TouchPointInfoPtr ti, int xitype = GetXIType(TouchGetPointerEventType(ev)); Mask xi_filter = event_get_filter_from_type(dev, xitype); + BUG_RETURN_VAL(!inputMasks, FALSE); + nt_list_for_each_entry(iclients, inputMasks->inputClients, next) { if (!(iclients->mask[dev->id] & xi_filter)) continue;