diff options
author | Andre Heider | 2009-10-03 19:27:10 +0000 |
---|---|---|
committer | Andre Heider | 2009-10-03 19:27:10 +0000 |
commit | 29bb8a59eeb9ad7f6cd2fa77c58e8cfc10f40ee7 (patch) | |
tree | c8b94733d791c10d5915c160ca8241bea4840dce | |
parent | e515b57b67fc65ac8df9574d6818aecc35bc7aed (diff) | |
download | scummvm-rg350-29bb8a59eeb9ad7f6cd2fa77c58e8cfc10f40ee7.tar.gz scummvm-rg350-29bb8a59eeb9ad7f6cd2fa77c58e8cfc10f40ee7.tar.bz2 scummvm-rg350-29bb8a59eeb9ad7f6cd2fa77c58e8cfc10f40ee7.zip |
If an error occured on constructing a VorbisInputStream, return 0 from makeVorbisStream, just like makeFlacStream does.
svn-id: r44556
-rw-r--r-- | sound/vorbis.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sound/vorbis.cpp b/sound/vorbis.cpp index 4b77274dc5..cd5f77a8fd 100644 --- a/sound/vorbis.cpp +++ b/sound/vorbis.cpp @@ -319,7 +319,14 @@ AudioStream *makeVorbisStream( uint32 endTime = duration ? (startTime + duration) : 0; - return new VorbisInputStream(stream, disposeAfterUse, startTime, endTime, numLoops); + VorbisInputStream *input = new VorbisInputStream(stream, disposeAfterUse, startTime, endTime, numLoops); + + if (input->endOfData()) { + delete input; + return 0; + } + + return input; } |