Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/dinput/dinput_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dlls/dinput/dinput_main.c b/dlls/dinput/dinput_main.c index b385cc7503c..bc35d6d77b3 100644 --- a/dlls/dinput/dinput_main.c +++ b/dlls/dinput/dinput_main.c @@ -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; } }