From 34ff8269185dded206173796383eb3bd4732c769 Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Mon, 18 Oct 2010 04:23:30 +0000 Subject: SCUMM: Check the sound channel is valid, before checking the sound channel. svn-id: r53561 --- engines/scumm/he/sound_he.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines') diff --git a/engines/scumm/he/sound_he.cpp b/engines/scumm/he/sound_he.cpp index 7bfd1de4cf..f059ee7d5e 100644 --- a/engines/scumm/he/sound_he.cpp +++ b/engines/scumm/he/sound_he.cpp @@ -241,7 +241,7 @@ int SoundHE::isSoundCodeUsed(int sound) { chan = i; } - if (_mixer->isSoundHandleActive(_heSoundChannels[chan]) && chan != -1) { + if (chan != -1 && _mixer->isSoundHandleActive(_heSoundChannels[chan])) { return _heChannel[chan].sbngBlock; } else { return 0; @@ -255,7 +255,7 @@ int SoundHE::getSoundPos(int sound) { chan = i; } - if (_mixer->isSoundHandleActive(_heSoundChannels[chan]) && chan != -1) { + if (chan != -1 && _mixer->isSoundHandleActive(_heSoundChannels[chan])) { int time = _vm->getHETimer(chan + 4) * _heChannel[chan].rate / 1000; return time; } else { -- cgit v1.2.3