mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-05 19:08:12 +00:00
Fixed Arithmetic overflow: Using operator '-' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '-' to avoid overflow (io.2).
This commit is contained in:
@@ -799,8 +799,8 @@ static int SDL_PrivateSendMouseButton(Uint64 timestamp, SDL_Window *window, SDL_
|
||||
Uint64 now = SDL_GetTicks();
|
||||
|
||||
if (now >= (clickstate->last_timestamp + mouse->double_click_time) ||
|
||||
SDL_fabs(mouse->x - clickstate->last_x) > mouse->double_click_radius ||
|
||||
SDL_fabs(mouse->y - clickstate->last_y) > mouse->double_click_radius) {
|
||||
SDL_fabs((double)mouse->x - clickstate->last_x) > mouse->double_click_radius ||
|
||||
SDL_fabs((double)mouse->y - clickstate->last_y) > mouse->double_click_radius) {
|
||||
clickstate->click_count = 0;
|
||||
}
|
||||
clickstate->last_timestamp = now;
|
||||
|
Reference in New Issue
Block a user