Commit 45a19b0c authored by Lucas Zawacki's avatar Lucas Zawacki Committed by Alexandre Julliard

dinput: Initialize all axis (from 0 to ABS_MAX) with -1.

parent 6eeb000c
...@@ -445,9 +445,10 @@ static JoystickImpl *alloc_device(REFGUID rguid, IDirectInputImpl *dinput, unsig ...@@ -445,9 +445,10 @@ static JoystickImpl *alloc_device(REFGUID rguid, IDirectInputImpl *dinput, unsig
newDevice->generic.base.crit.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": JoystickImpl*->base.crit"); newDevice->generic.base.crit.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": JoystickImpl*->base.crit");
/* Count number of available axes - supported Axis & POVs */ /* Count number of available axes - supported Axis & POVs */
for (i = 0; i < WINE_JOYSTICK_MAX_AXES; i++) for (i = 0; i < ABS_MAX; i++)
{ {
if (test_bit(newDevice->joydev->absbits, i)) if (i < WINE_JOYSTICK_MAX_AXES &&
test_bit(newDevice->joydev->absbits, i))
{ {
newDevice->generic.device_axis_count++; newDevice->generic.device_axis_count++;
newDevice->dev_axes_to_di[i] = idx; newDevice->dev_axes_to_di[i] = idx;
......
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