aboutsummaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorJames Brown2002-10-15 14:17:59 +0000
committerJames Brown2002-10-15 14:17:59 +0000
commitbc6d4f130b3e9496776001f6145db10ff28c46f5 (patch)
treeab427d3aa191adebfcac434eea6e738d6131244f /sound
parent0b43ca86a7aeac418606b4ce48aec8b84edb11b9 (diff)
downloadscummvm-rg350-bc6d4f130b3e9496776001f6145db10ff28c46f5.tar.gz
scummvm-rg350-bc6d4f130b3e9496776001f6145db10ff28c46f5.tar.bz2
scummvm-rg350-bc6d4f130b3e9496776001f6145db10ff28c46f5.zip
Sanity checking to fix crash caused by latest sound commits
svn-id: r5151
Diffstat (limited to 'sound')
-rw-r--r--sound/mixer.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/sound/mixer.cpp b/sound/mixer.cpp
index d4433f0045..931f8c05aa 100644
--- a/sound/mixer.cpp
+++ b/sound/mixer.cpp
@@ -112,6 +112,11 @@ int SoundMixer::playStream(PlayingSoundHandle * handle, int idx, void * sound, u
}
void SoundMixer::stopChannel(int index) {
+ if (index < 0) {
+ warning("soundMixer::stopChannel has invalid index %d", index);
+ return;
+ }
+
if (_channels[index] == NULL) {
_channels[index]->_toBeDestroyed = true;
}