Mercurial > SDL_sound_CoreAudio
diff decoders/smpeg.c @ 517:0f5888f9aef7 stable-1.0
Fixed bogus memory deference when SMPEG fails init (thanks, Chris!).
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Sun, 29 Oct 2006 07:14:48 +0000 |
parents | 45614e2c1c81 |
children | 50bb9a6cebfe |
line wrap: on
line diff
--- a/decoders/smpeg.c Sat Oct 28 00:53:45 2006 +0000 +++ b/decoders/smpeg.c Sun Oct 29 07:14:48 2006 +0000 @@ -116,6 +116,7 @@ SDL_AudioSpec spec; Sound_SampleInternal *internal = (Sound_SampleInternal *) sample->opaque; SDL_RWops *refCounter; + const char *err = NULL; output_version(); @@ -171,10 +172,12 @@ RWops_RWRefCounter_addRef(refCounter); smpeg = SMPEG_new_rwops(refCounter, &smpeg_info, 0); - if (SMPEG_error(smpeg)) + err = SMPEG_error(smpeg); + if (err != NULL) { + __Sound_SetError(err); /* make a copy before SMPEG_delete()... */ SMPEG_delete(smpeg); - BAIL_MACRO(SMPEG_error(smpeg), 0); + return(0); } /* if */ if (!smpeg_info.has_audio)