From f22e83105b992857e8d3a75631ddbfea47c67bd8 Mon Sep 17 00:00:00 2001 From: gewlitys Date: Tue, 20 May 2003 00:43:24 +0000 Subject: [PATCH] Fix crash in PlayStream when whole file is prebuffered and its not speech (bug #259) git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@966 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/ChangeLog | 2 ++ sc2/src/sc2code/libs/sound/stream.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sc2/ChangeLog b/sc2/ChangeLog index 53901598d..96e5c21dd 100644 --- a/sc2/ChangeLog +++ b/sc2/ChangeLog @@ -1,4 +1,6 @@ Changes towards version 0.3: +- Fix crash in PlayStream when whole file is prebuffered and its not + speech (bug #259) -Mika - Fix endian problem in colormap transform code (bug #137) -Mika - Fix minor glitch in planet coarse scan (bug #238), from chmmravatar - Wav loader is now endian safe (bug #165) -Mika diff --git a/sc2/src/sc2code/libs/sound/stream.c b/sc2/src/sc2code/libs/sound/stream.c index a734dfc0f..bc39677d2 100644 --- a/sc2/src/sc2code/libs/sound/stream.c +++ b/sc2/src/sc2code/libs/sound/stream.c @@ -80,7 +80,8 @@ PlayStream (TFB_SoundSample *sample, uint32 source, bool looping, bool scope, bo if (sample->decoder->error) { - if (sample->decoder->error == SOUNDDECODER_EOF && sample->read_chain_ptr->next) + if (sample->decoder->error == SOUNDDECODER_EOF && + sample->read_chain_ptr && sample->read_chain_ptr->next) { sample->read_chain_ptr = sample->read_chain_ptr->next; sample->decoder = sample->read_chain_ptr->decoder;