aboutsummaryrefslogtreecommitdiff
path: root/src/adlmidi_midiplay.cpp
diff options
context:
space:
mode:
authorVitaly Novichkov <admin@wohlnet.ru>2018-09-30 18:58:13 +0300
committerVitaly Novichkov <admin@wohlnet.ru>2018-09-30 18:58:13 +0300
commit77e8b86be524edf42a7070e2b7a1f6f67d7cfaa8 (patch)
tree82e77298d966a3295c88479ac3ae1abc5a1f84f8 /src/adlmidi_midiplay.cpp
parent10c6c335697cd7e570d06089c61c1fae8acb29e1 (diff)
downloadlibADLMIDI-77e8b86be524edf42a7070e2b7a1f6f67d7cfaa8.tar.gz
libADLMIDI-77e8b86be524edf42a7070e2b7a1f6f67d7cfaa8.tar.bz2
libADLMIDI-77e8b86be524edf42a7070e2b7a1f6f67d7cfaa8.zip
Move "MaxChips" constant macro into adlmidi_private.hpp
Diffstat (limited to 'src/adlmidi_midiplay.cpp')
-rw-r--r--src/adlmidi_midiplay.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/adlmidi_midiplay.cpp b/src/adlmidi_midiplay.cpp
index 673ec30..1e1da07 100644
--- a/src/adlmidi_midiplay.cpp
+++ b/src/adlmidi_midiplay.cpp
@@ -1465,6 +1465,8 @@ void MIDIplay::killOrEvacuate(size_t from_channel,
AdlChannel::LocationData *j,
MIDIplay::MIDIchannel::activenoteiterator i)
{
+ uint32_t maxChannels = ADL_MAX_CHIPS * 18;
+
// Before killing the note, check if it can be
// evacuated to another channel as an arpeggio
// instrument. This helps if e.g. all channels
@@ -1474,6 +1476,8 @@ void MIDIplay::killOrEvacuate(size_t from_channel,
{
uint16_t cs = static_cast<uint16_t>(c);
+ if(c >= maxChannels)
+ break;
if(c == from_channel)
continue;
if(m_synth.m_channelCategory[c] != m_synth.m_channelCategory[from_channel])