mirror of
https://github.com/scummvm/scummvm.git
synced 2026-06-20 05:45:29 +00:00
Act more gracefully when failing to load a (VOC) sound (should help bug #889442)
svn-id: r12719
This commit is contained in:
@@ -830,6 +830,11 @@ void Sound::startSfxSound(File *file, int file_size, PlayingSoundHandle *handle,
|
||||
} else {
|
||||
input = makeVOCStream(_sfxFile);
|
||||
}
|
||||
|
||||
if (!input) {
|
||||
warning("startSfxSound failed to load sound");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (_vm->_imuseDigital) {
|
||||
//_vm->_imuseDigital->stopSound(kTalkSoundID);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user