diff --git a/src/SDL12_compat.c b/src/SDL12_compat.c index 192b9b7fb..fba2e5642 100644 --- a/src/SDL12_compat.c +++ b/src/SDL12_compat.c @@ -8454,12 +8454,12 @@ SDL_LoadWAV_RW(SDL12_RWops *rwops12, int freerwops12, SDL_RWops *rwops20 = RWops12to20(rwops12); SDL_AudioSpec *retval = NULL; + *buf = NULL; + if (!rwops20) { return NULL; } - *buf = NULL; - /* SDL2's LoadWAV requires a seekable stream, but SDL 1.2 didn't, so if the stream appears unseekable, try to load it into a memory rwops that we _can_ seek in */