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:
Ken Thomases 2015-03-18 14:02:13 -05:00 committed by Alexandre Julliard
parent 40d806dc95
commit 77432ac45d
1 changed files with 1 additions and 1 deletions

View File

@ -528,7 +528,7 @@ static BOOL open_joystick(joystick_t* joystick)
}
index = joystick - joysticks;
if (index > CFArrayGetCount(device_main_elements))
if (index >= CFArrayGetCount(device_main_elements))
return FALSE;
joystick->element = (IOHIDElementRef)CFArrayGetValueAtIndex(device_main_elements, index);