aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
}