# HG changeset patch # User Ryan C. Gordon # Date 1162106088 0 # Node ID 0f5888f9aef76b7253fbba44efc15363e75d6602 # Parent c5f184b4b2cd5d1d72d80cd6a9b645f30dafe9eb Fixed bogus memory deference when SMPEG fails init (thanks, Chris!). diff -r c5f184b4b2cd -r 0f5888f9aef7 CHANGELOG --- a/CHANGELOG Sat Oct 28 00:53:45 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!). 05122006 - Patched to get mpglib compiling again (thanks, Sam!). diff -r c5f184b4b2cd -r 0f5888f9aef7 CREDITS --- a/CREDITS Sat Oct 28 00:53:45 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 c5f184b4b2cd -r 0f5888f9aef7 decoders/smpeg.c --- 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)