Fixed bug 5465 - Invalid memcpy inside SDL_GestureDelTouch (Thanks dmikushin and Yuki Okumura)

main
Sylvain Becker 2021-01-10 22:21:12 +01:00
parent b94718e0a7
commit 68815b6c06
1 changed files with 3 additions and 1 deletions

View File

@ -487,7 +487,9 @@ int SDL_GestureDelTouch(SDL_TouchID touchId)
SDL_zero(SDL_gestureTouch[i]);
SDL_numGestureTouches--;
SDL_memcpy(&SDL_gestureTouch[i], &SDL_gestureTouch[SDL_numGestureTouches], sizeof(SDL_gestureTouch[i]));
if (i != SDL_numGestureTouches) {
SDL_memcpy(&SDL_gestureTouch[i], &SDL_gestureTouch[SDL_numGestureTouches], sizeof(SDL_gestureTouch[i]));
}
return 0;
}