Fixes https://github.com/libsdl-org/SDL/issues/8355 (cherry picked from commit 34b09be6a5)
34b09be6a5