Fixes https://github.com/libsdl-org/SDL/issues/13867 (cherry picked from commit ea1a769322)
ea1a769322