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:
Rémi Bernon 2021-10-12 22:31:44 +02:00 committed by Alexandre Julliard
parent 01ddc2f8e4
commit 50f889fd19
1 changed files with 2 additions and 1 deletions

View File

@ -833,7 +833,8 @@ static HRESULT WINAPI IDirectInput8WImpl_EnumDevicesBySemantics(
if (enumSuccess == S_OK &&
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;
}
}