diff options
Diffstat (limited to 'sound')
-rw-r--r-- | sound/mixer.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/mixer.cpp b/sound/mixer.cpp index 931f8c05aa..e13f6c601b 100644 --- a/sound/mixer.cpp +++ b/sound/mixer.cpp @@ -112,12 +112,12 @@ int SoundMixer::playStream(PlayingSoundHandle * handle, int idx, void * sound, u } void SoundMixer::stopChannel(int index) { - if (index < 0) { + if ((index < 0) || (index >= NUM_CHANNELS)) { warning("soundMixer::stopChannel has invalid index %d", index); return; } - if (_channels[index] == NULL) { + if (_channels[index] != NULL) { _channels[index]->_toBeDestroyed = true; } } |