Fixes https://github.com/libsdl-org/SDL/issues/14500 (cherry picked from commit 1fc093491a)
1fc093491a