aboutsummaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorMax Horn2004-02-03 08:53:13 +0000
committerMax Horn2004-02-03 08:53:13 +0000
commitf36710f8b4e5d28517fdcb35ac4fefbd15734be7 (patch)
tree357832b8aec085f1a188a4950d794c2202fac0ae /sound
parent43efc8bed0d908357c2bb0d0c626cdaba9cb35a8 (diff)
downloadscummvm-rg350-f36710f8b4e5d28517fdcb35ac4fefbd15734be7.tar.gz
scummvm-rg350-f36710f8b4e5d28517fdcb35ac4fefbd15734be7.tar.bz2
scummvm-rg350-f36710f8b4e5d28517fdcb35ac4fefbd15734be7.zip
Act more gracefully when failing to load a (VOC) sound (should help bug #889442)
svn-id: r12719
Diffstat (limited to 'sound')
-rw-r--r--sound/voc.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/sound/voc.cpp b/sound/voc.cpp
index 80027fb143..ef1741111f 100644
--- a/sound/voc.cpp
+++ b/sound/voc.cpp
@@ -156,6 +156,9 @@ AudioStream *makeVOCStream(byte *ptr) {
int size, rate, loops;
byte *data = readVOCFromMemory(ptr, size, rate, loops);
+ if (!data)
+ return 0;
+
return makeLinearInputStream(rate, SoundMixer::FLAG_AUTOFREE | SoundMixer::FLAG_UNSIGNED, data, size, 0, 0);
}
@@ -163,6 +166,9 @@ AudioStream *makeVOCStream(File *file) {
int size, rate;
byte *data = loadVOCFile(file, size, rate);
+ if (!data)
+ return 0;
+
return makeLinearInputStream(rate, SoundMixer::FLAG_AUTOFREE | SoundMixer::FLAG_UNSIGNED, data, size, 0, 0);
}