mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
mi: don't crash on miPointerGetPosition for disabled devices
If a device is disabled, its master device is forcibly reset to NULL but
unlike a floating device it doesn't have a sprite allocated. Calling
miPointerGetPosition for a disabled device thus crashes.
Avoid this by returning 0/0 for any device without a miPointer.
This is a quick fix only, a proper fix for this issue is rather more
involved.
Closes #1782
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1771>
(cherry picked from commit acbdd0ecdd)
This commit is contained in:
committed by
Alan Coopersmith
parent
ad0dcca251
commit
6c0d820635
@@ -718,8 +718,15 @@ miPointerSetPosition(DeviceIntPtr pDev, int mode, double *screenx,
|
||||
void
|
||||
miPointerGetPosition(DeviceIntPtr pDev, int *x, int *y)
|
||||
{
|
||||
*x = MIPOINTER(pDev)->x;
|
||||
*y = MIPOINTER(pDev)->y;
|
||||
miPointerPtr pPointer = MIPOINTER(pDev);
|
||||
if (pPointer) {
|
||||
*x = pPointer->x;
|
||||
*y = pPointer->y;
|
||||
}
|
||||
else {
|
||||
*x = 0;
|
||||
*y = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user