winejoystick: Fix a crash on accessing a CFArray past its end due to an off-by-one error in the Mac code.
This commit is contained in:
parent
40d806dc95
commit
77432ac45d
|
@ -528,7 +528,7 @@ static BOOL open_joystick(joystick_t* joystick)
|
||||||
}
|
}
|
||||||
|
|
||||||
index = joystick - joysticks;
|
index = joystick - joysticks;
|
||||||
if (index > CFArrayGetCount(device_main_elements))
|
if (index >= CFArrayGetCount(device_main_elements))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
joystick->element = (IOHIDElementRef)CFArrayGetValueAtIndex(device_main_elements, index);
|
joystick->element = (IOHIDElementRef)CFArrayGetValueAtIndex(device_main_elements, index);
|
||||||
|
|
Loading…
Reference in New Issue