dinput: Fix invalid use of post-incremented device_count value.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
01ddc2f8e4
commit
50f889fd19
|
@ -833,7 +833,8 @@ static HRESULT WINAPI IDirectInput8WImpl_EnumDevicesBySemantics(
|
||||||
if (enumSuccess == S_OK &&
|
if (enumSuccess == S_OK &&
|
||||||
should_enumerate_device(ptszUserName, dwFlags, &This->device_players, &didevi.guidInstance))
|
should_enumerate_device(ptszUserName, dwFlags, &This->device_players, &didevi.guidInstance))
|
||||||
{
|
{
|
||||||
didevis = realloc( didevis, sizeof(DIDEVICEINSTANCEW) * device_count++ );
|
device_count++;
|
||||||
|
didevis = realloc( didevis, sizeof(DIDEVICEINSTANCEW) * device_count );
|
||||||
didevis[device_count-1] = didevi;
|
didevis[device_count-1] = didevi;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue