diff options
author | Paul Gilbert | 2012-11-18 10:31:58 +1100 |
---|---|---|
committer | Paul Gilbert | 2012-11-18 10:31:58 +1100 |
commit | 832f06fa8ac761e8cae5811a54629fd77e83e336 (patch) | |
tree | 7307509102b72bc77e92bba6194ee06a0393aab4 | |
parent | 3da8683c48780520ae5302cecc3d3dd670433c42 (diff) | |
download | scummvm-rg350-832f06fa8ac761e8cae5811a54629fd77e83e336.tar.gz scummvm-rg350-832f06fa8ac761e8cae5811a54629fd77e83e336.tar.bz2 scummvm-rg350-832f06fa8ac761e8cae5811a54629fd77e83e336.zip |
HOPKINS: Bugfix for crash when pushing button in purgatory control room
-rw-r--r-- | engines/hopkins/sound.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/engines/hopkins/sound.cpp b/engines/hopkins/sound.cpp index 519d43b05a..8974d3e9fe 100644 --- a/engines/hopkins/sound.cpp +++ b/engines/hopkins/sound.cpp @@ -625,7 +625,7 @@ void SoundManager::PLAY_WAV(int wavIndex) { int SoundManager::VOICE_STAT(int voiceIndex) { if (Voice[voiceIndex]._status) { int wavIndex = Voice[voiceIndex]._wavIndex; - if (Swav[wavIndex]._audioStream->endOfStream()) + if (Swav[wavIndex]._audioStream != NULL && Swav[wavIndex]._audioStream->endOfStream()) STOP_VOICE(voiceIndex); } @@ -670,10 +670,11 @@ void SoundManager::PLAY_VOICE_SDL() { bool SoundManager::DEL_SAMPLE_SDL(int wavIndex) { if (Swav[wavIndex]._active) { - Swav[wavIndex]._active = false; - _vm->_mixer->stopHandle(Swav[wavIndex]._soundHandle); delete Swav[wavIndex]._audioStream; + Swav[wavIndex]._audioStream = NULL; + Swav[wavIndex]._active = false; + return true; } else { return false; |