Commit 472c2d1a authored by Michal Suchánek's avatar Michal Suchánek Committed by Peter Hutterer

Fix crash for motion events from devices without valuators

A WarpPointer request may trigger a motion event on a device without
valuators. That request is ignored by GetPointerEvents but during smooth
scroll emulation we dereference dev->valuators to get the number of axes.

Break out early if the device doesn't have valuators.
Signed-off-by: Michal Suchánek's avatarMichal Suchanek <hramrach@gmail.com>
Reviewed-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 88c767ed)
parent 97cae5e0
......@@ -1574,7 +1574,7 @@ GetPointerEvents(InternalEvent *events, DeviceIntPtr pDev, int type,
/* Now turn the smooth-scrolling axes back into emulated button presses
* for legacy clients, based on the integer delta between before and now */
for (i = 0; i < valuator_mask_size(&mask); i++) {
if (i >= pDev->valuator->numAxes)
if ( !pDev->valuator || (i >= pDev->valuator->numAxes))
break;
if (!valuator_mask_isset(&mask, i))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment