mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Added some logic to MidiDataConcatenator that avoids asserting on invalid input data
This commit is contained in:
parent
ec40f0940c
commit
1a5f71b74d
1 changed files with 10 additions and 3 deletions
|
|
@ -71,8 +71,7 @@ public:
|
|||
// the normal message, handle it now..
|
||||
if (*d >= 0xf8 && *d <= 0xfe)
|
||||
{
|
||||
const MidiMessage m (*d++, time);
|
||||
callback.handleIncomingMidiMessage (input, m);
|
||||
callback.handleIncomingMidiMessage (input, MidiMessage (*d++, time));
|
||||
--numBytes;
|
||||
}
|
||||
else
|
||||
|
|
@ -83,7 +82,15 @@ public:
|
|||
data[len++] = *d++;
|
||||
--numBytes;
|
||||
|
||||
if (len >= MidiMessage::getMessageLengthFromFirstByte (data[0]))
|
||||
const uint8 firstByte = data[0];
|
||||
|
||||
if (firstByte < 0x80 || firstByte == 0xf7)
|
||||
{
|
||||
len = 0;
|
||||
break; // ignore this malformed MIDI message..
|
||||
}
|
||||
|
||||
if (len >= MidiMessage::getMessageLengthFromFirstByte (firstByte))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue