range-checking for keys of input-events

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1343 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2008-07-18 22:17:22 +00:00
parent 6703c06fcd
commit a10a7901aa

View File

@@ -127,6 +127,15 @@ void midiPort::processInEvent( const midiEvent & _me, const midiTime & _time )
if( ( mode() == Input || mode() == Duplex ) &&
( inputChannel()-1 == _me.m_channel || inputChannel() == 0 ) )
{
if( _me.m_type == MidiNoteOn ||
_me.m_type == MidiNoteOff ||
_me.m_type == MidiKeyPressure )
{
if( _me.key() < 0 || _me.key() >= NumKeys )
{
return;
}
}
midiEvent ev = _me;
if( m_defaultVelocityInEnabledModel.value() == TRUE &&
_me.velocity() > 0 )