diff options
-rw-r--r-- | engines/hdb/sound.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/engines/hdb/sound.cpp b/engines/hdb/sound.cpp index 842b145894..4579212937 100644 --- a/engines/hdb/sound.cpp +++ b/engines/hdb/sound.cpp @@ -1538,6 +1538,11 @@ void Sound::playSound(int index) { audioStream = Audio::makeWAVStream(stream, DisposeAfterUse::YES); } + if (audioStream == 0) { + warning("playSound: sound %d is corrupt", index); + return; + } + g_hdb->_mixer->playStream( Audio::Mixer::kSFXSoundType, &_handles[soundChannel], @@ -1597,6 +1602,11 @@ void Sound::playSoundEx(int index, int channel, bool loop) { audioStream = Audio::makeWAVStream(stream, DisposeAfterUse::YES); } + if (audioStream == 0) { + warning("playSoundEx: sound %d is corrupt", index); + return; + } + if (loop) { Audio::AudioStream *loopingStream = new Audio::LoopingAudioStream(audioStream, 0, DisposeAfterUse::YES); g_hdb->_mixer->playStream( |