# HG changeset patch # User Ryan C. Gordon # Date 1162106088 0 # Node ID 16cbfcb8d7fb3afe21013b4bb2463af6d52ce6d4 # Parent 46d5f399cb3534c764ca0518c2d2dfce47e9ee2c Fixed bogus memory deference when SMPEG fails init (thanks, Chris!). diff -r 46d5f399cb35 -r 16cbfcb8d7fb CHANGELOG --- a/CHANGELOG Sat Oct 28 00:57:10 2006 +0000 +++ b/CHANGELOG Sun Oct 29 07:14:48 2006 +0000 @@ -2,6 +2,7 @@ * CHANGELOG. */ +10292006 - Fixed bogus memory deference when SMPEG fails init (thanks, Chris!) 10272006 - FLAC 1.1.3 breaks their API _again_, so we try to do the right thing at build time. (Thanks, Josh!). 07282006 - Ogg Vorbis decoding defaults to system byte order now. diff -r 46d5f399cb35 -r 16cbfcb8d7fb CREDITS --- a/CREDITS Sat Oct 28 00:57:10 2006 +0000 +++ b/CREDITS Sun Oct 29 07:14:48 2006 +0000 @@ -56,6 +56,9 @@ FLAC 1.1.3 updates: Josh Coalson +SMPEG fixes: + Chris Nelson + Other stuff: Your name here! Patches go to icculus@clutteredmind.org ... diff -r 46d5f399cb35 -r 16cbfcb8d7fb decoders/smpeg.c --- a/decoders/smpeg.c Sat Oct 28 00:57:10 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)