aboutsummaryrefslogtreecommitdiff
path: root/sound/decoders
diff options
context:
space:
mode:
authorJohannes Schickel2010-03-22 15:54:56 +0000
committerJohannes Schickel2010-03-22 15:54:56 +0000
commit86653687d7369a46ac25ef4a3cd513b401807c67 (patch)
tree72b8042a9325fbf89e0271d37e484d86d5973c9f /sound/decoders
parenta725b490e8a190e276fc689d4a147b7c49e98d7c (diff)
downloadscummvm-rg350-86653687d7369a46ac25ef4a3cd513b401807c67.tar.gz
scummvm-rg350-86653687d7369a46ac25ef4a3cd513b401807c67.tar.bz2
scummvm-rg350-86653687d7369a46ac25ef4a3cd513b401807c67.zip
Fix for bug #2969211 "NIPPON: Crash in Intro".
It is not a good idea to supply an SubLoopingAudioStream with the start and end time to be exactly the same time. Clarify that in the SubLoopingAudioStream documentation, add an assert in the SubLoopingAudioStream constructor for that case and also prevent make8SVXStream from doing so. svn-id: r48356
Diffstat (limited to 'sound/decoders')
-rw-r--r--sound/decoders/iff_sound.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/sound/decoders/iff_sound.cpp b/sound/decoders/iff_sound.cpp
index b365015a2b..92054901e4 100644
--- a/sound/decoders/iff_sound.cpp
+++ b/sound/decoders/iff_sound.cpp
@@ -117,9 +117,11 @@ AudioStream *make8SVXStream(Common::ReadStream &input, bool loop) {
loopStart = loader._header.oneShotHiSamples;
loopEnd = loader._header.oneShotHiSamples + loader._header.repeatHiSamples;
- return new SubLoopingAudioStream(stream, 0,
+ if (loopStart != loopEnd) {
+ return new SubLoopingAudioStream(stream, 0,
Timestamp(0, loopStart, loader._header.samplesPerSec),
Timestamp(0, loopEnd, loader._header.samplesPerSec));
+ }
}
return stream;