libsdl-org / sdl12-compat

An SDL-1.2 compatibility layer that uses SDL 2.0 behind the scenes.
Other
194 stars 40 forks source link

Add null check to SDL_LoadWAV_RW to avoid crashes #311

Closed zmanuel closed 1 year ago

zmanuel commented 1 year ago

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 https://github.com/libsdl-org/sdl12-compat/issues/310