aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
}