InstrumentTrack: make sure m_runningMidiNotes[x] does not become negative
Even though there's no known code path for this event to happen we should always make sure m_runningMidiNotes[x] does not become negative as this might mess up future key events.
This commit is contained in:
@@ -386,6 +386,7 @@ void InstrumentTrack::processOutEvent( const midiEvent & _me,
|
||||
if( k >= 0 && k < NumKeys &&
|
||||
--m_runningMidiNotes[k] <= 0 )
|
||||
{
|
||||
m_runningMidiNotes[k] = qMax( 0, m_runningMidiNotes[k] );
|
||||
m_instrument->handleMidiEvent(
|
||||
midiEvent( MidiNoteOff, midiPort()->realOutputChannel(), k, 0 ),
|
||||
_time );
|
||||
|
||||
Reference in New Issue
Block a user