aboutsummaryrefslogtreecommitdiff
path: root/sound/vorbis.cpp
diff options
context:
space:
mode:
authorAndre Heider2009-10-03 19:27:10 +0000
committerAndre Heider2009-10-03 19:27:10 +0000
commit29bb8a59eeb9ad7f6cd2fa77c58e8cfc10f40ee7 (patch)
treec8b94733d791c10d5915c160ca8241bea4840dce /sound/vorbis.cpp
parente515b57b67fc65ac8df9574d6818aecc35bc7aed (diff)
downloadscummvm-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
Diffstat (limited to 'sound/vorbis.cpp')
-rw-r--r--sound/vorbis.cpp9
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;
}