You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With native SDL 1.2, that used to return NULL and set an appropriate error.
To reproduce, simply call the loopwave test with a nonsense argument.
The fix is a simple standard early NULL check with return in SDL_LoadWAV_RW, I'll submit a PR momentarily.
We found this because our silly old game uses SDL_LoadWAV to just speculatively load optional sound files, and that crashes now: https://forums3.armagetronad.net/viewtopic.php?t=39657
A workaround is already in the release pipeline, so no hurry.
Looking around:
The similar SDL_LoadBMP(_RW) handles NULL arguments fine already.
I have not looked too deeply into SDL_SaveBMP. Calling it with both arguments NULL crashes, too, but because of the NULL surface argument; in native SDL1.2, a NULL surface and a valid file would already crash.
The text was updated successfully, but these errors were encountered:
zmanuel
added a commit
to zmanuel/sdl12-compat
that referenced
this issue
Aug 6, 2023
Native SDL 1.2 and 2.0 both handle SDL_LoadWAV(null,...), SDL_LoadWAV("",...) and SDL_LoadWAV(nonexistent_file,...)
by returning NULL and setting an error; this check resores that
behavior.
Fixeslibsdl-org#310
Native SDL 1.2 and 2.0 both handle SDL_LoadWAV(null,...), SDL_LoadWAV("",...) and SDL_LoadWAV(nonexistent_file,...)
by returning NULL and setting an error; this check resores that
behavior.
Fixes#310
With native SDL 1.2, that used to return NULL and set an appropriate error.
To reproduce, simply call the loopwave test with a nonsense argument.
The fix is a simple standard early NULL check with return in SDL_LoadWAV_RW, I'll submit a PR momentarily.
We found this because our silly old game uses SDL_LoadWAV to just speculatively load optional sound files, and that crashes now: https://forums3.armagetronad.net/viewtopic.php?t=39657
A workaround is already in the release pipeline, so no hurry.
Looking around:
The similar SDL_LoadBMP(_RW) handles NULL arguments fine already.
I have not looked too deeply into SDL_SaveBMP. Calling it with both arguments NULL crashes, too, but because of the NULL surface argument; in native SDL1.2, a NULL surface and a valid file would already crash.
The text was updated successfully, but these errors were encountered: