Fix IsXtstDevice - returns false positives since 0814f511d5
.
Missing check for the value of 'mid' returned false positives if master was NULL. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
3525d14056
commit
50a2a8dc76
|
@ -2625,16 +2625,23 @@ int AllocXtstDevice (ClientPtr client, char* name,
|
||||||
BOOL
|
BOOL
|
||||||
IsXtstDevice(DeviceIntPtr dev, DeviceIntPtr master)
|
IsXtstDevice(DeviceIntPtr dev, DeviceIntPtr master)
|
||||||
{
|
{
|
||||||
|
int is_xtst = FALSE;
|
||||||
int mid;
|
int mid;
|
||||||
void *tmp; /* shut up, gcc! */
|
void *tmp; /* shut up, gcc! */
|
||||||
|
|
||||||
if (IsMaster(dev))
|
if (IsMaster(dev))
|
||||||
return FALSE;
|
return is_xtst;
|
||||||
|
|
||||||
tmp = dixLookupPrivate(&dev->devPrivates, XTstDevicePrivateKey);
|
tmp = dixLookupPrivate(&dev->devPrivates, XTstDevicePrivateKey);
|
||||||
mid = (int)tmp;
|
mid = (int)tmp;
|
||||||
|
|
||||||
return (!master || mid == master->id);
|
/* deviceid 0 is reserved for XIAllDevices, non-zero mid means xtst
|
||||||
|
* device */
|
||||||
|
if ((!master && mid) ||
|
||||||
|
(master && mid == master->id))
|
||||||
|
is_xtst = TRUE;
|
||||||
|
|
||||||
|
return is_xtst;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue
Block a user