add null pointer checks for listener, dev and ti

This commit is contained in:
Frederik Hertzum 2025-07-05 12:33:56 +02:00
parent 23e83724df
commit be7750e512

View File

@ -1294,13 +1294,13 @@ RetrieveTouchDeliveryData(DeviceIntPtr dev, TouchPointInfoPtr ti,
*mask = NULL;
*grab = NULL;
if (listener->type == LISTENER_GRAB ||
if (listener && listener->type == LISTENER_GRAB ||
listener->type == LISTENER_POINTER_GRAB) {
*grab = listener->grab;
BUG_RETURN_VAL(!*grab, FALSE);
}
else if (ti->emulate_pointer && dev->deviceGrab.grab &&
else if (ti && ti->emulate_pointer && dev && dev->deviceGrab.grab &&
!dev->deviceGrab.fromPassiveGrab) {
/* There may be an active pointer grab on the device */
*grab = dev->deviceGrab.grab;