Skip to content

Commit

Permalink
Fixed bug 4898 - No rumble because of integer overflow in SDL_Joystic…
Browse files Browse the repository at this point in the history
…kRumble

meyraud705

Switch hidapi and xinput also need to check for overflow, attached a patch for them.
  • Loading branch information
slouken committed Jan 26, 2020
1 parent 5e64998 commit 7ea3f5b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/joystick/windows/SDL_xinputjoystick.c
Expand Up @@ -480,7 +480,7 @@ SDL_XINPUT_JoystickRumble(SDL_Joystick * joystick, Uint16 low_frequency_rumble,
}

if ((low_frequency_rumble || high_frequency_rumble) && duration_ms) {
joystick->hwdata->rumble_expiration = SDL_GetTicks() + duration_ms;
joystick->hwdata->rumble_expiration = SDL_GetTicks() + SDL_min(duration_ms, SDL_MAX_RUMBLE_DURATION_MS);
} else {
joystick->hwdata->rumble_expiration = 0;
}
Expand Down

0 comments on commit 7ea3f5b

Please sign in to comment.