From b9bca313d2ed992ca801a0140bd27ea2a000e678 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 4 Jun 2024 16:43:20 +0200 Subject: [PATCH] CoreMIDI: fix crash when receiving long MIDI messages CoreMidiIo::recv_event imposes a limit of 1024 bytes/packet. --- libs/backends/coreaudio/coremidi_io.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/backends/coreaudio/coremidi_io.h b/libs/backends/coreaudio/coremidi_io.h index 84339d58a5..ce41560c45 100644 --- a/libs/backends/coreaudio/coremidi_io.h +++ b/libs/backends/coreaudio/coremidi_io.h @@ -38,7 +38,7 @@ namespace ARDOUR { typedef struct _CoreMIDIPacket { MIDITimeStamp timeStamp; UInt16 length; - Byte data[256]; + Byte data[1024]; #if 0 // unused _CoreMIDIPacket (MIDITimeStamp t, Byte *d, UInt16 l) : timeStamp(t) @@ -56,6 +56,7 @@ typedef struct _CoreMIDIPacket { : timeStamp(other->timeStamp) , length (other->length) { + assert (l <= 1024); if (length > 0) { memcpy(data, other->data, length); }