mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-15 14:18:37 +00:00
HDB: Guard for corrupted sound data
This commit is contained in:
parent
d16e6a7d49
commit
9d028ac4ac
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user