mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-12 09:36:33 +01:00
CoreMIDI: fix crash when receiving long MIDI messages
CoreMidiIo::recv_event imposes a limit of 1024 bytes/packet.
This commit is contained in:
parent
0ec926668c
commit
b9bca313d2
1 changed files with 2 additions and 1 deletions
|
|
@ -38,7 +38,7 @@ namespace ARDOUR {
|
||||||
typedef struct _CoreMIDIPacket {
|
typedef struct _CoreMIDIPacket {
|
||||||
MIDITimeStamp timeStamp;
|
MIDITimeStamp timeStamp;
|
||||||
UInt16 length;
|
UInt16 length;
|
||||||
Byte data[256];
|
Byte data[1024];
|
||||||
#if 0 // unused
|
#if 0 // unused
|
||||||
_CoreMIDIPacket (MIDITimeStamp t, Byte *d, UInt16 l)
|
_CoreMIDIPacket (MIDITimeStamp t, Byte *d, UInt16 l)
|
||||||
: timeStamp(t)
|
: timeStamp(t)
|
||||||
|
|
@ -56,6 +56,7 @@ typedef struct _CoreMIDIPacket {
|
||||||
: timeStamp(other->timeStamp)
|
: timeStamp(other->timeStamp)
|
||||||
, length (other->length)
|
, length (other->length)
|
||||||
{
|
{
|
||||||
|
assert (l <= 1024);
|
||||||
if (length > 0) {
|
if (length > 0) {
|
||||||
memcpy(data, other->data, length);
|
memcpy(data, other->data, length);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue