aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2012-11-18 10:31:58 +1100
committerPaul Gilbert2012-11-18 10:31:58 +1100
commit832f06fa8ac761e8cae5811a54629fd77e83e336 (patch)
tree7307509102b72bc77e92bba6194ee06a0393aab4
parent3da8683c48780520ae5302cecc3d3dd670433c42 (diff)
downloadscummvm-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.cpp7
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;