From 1307cce11bb5ffef7774d277fc5b1fe36d97f19f Mon Sep 17 00:00:00 2001 From: Rui Barreiros Date: Mon, 16 Oct 2023 19:06:36 +0100 Subject: [PATCH] Fix for wrong size of message.length --- src/MIDI.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/MIDI.hpp b/src/MIDI.hpp index 610e1441..11d9776d 100644 --- a/src/MIDI.hpp +++ b/src/MIDI.hpp @@ -893,6 +893,7 @@ bool MidiInterface::parse() mMessage.data1 = 0; mMessage.data2 = 0; mMessage.valid = true; + mMessage.length = 1; // Do not reset all input attributes, Running Status must remain unchanged. // We still need to reset these @@ -948,7 +949,7 @@ bool MidiInterface::parse() mMessage.channel = getChannelFromStatusByte(mPendingMessage[0]); mMessage.data1 = mPendingMessage[1]; mMessage.data2 = 0; // Completed new message has 1 data byte - mMessage.length = 1; + mMessage.length = 2; // Shouldn't be 1, send() checks if length > 1 to send data1, thus length needs to be 2 mPendingMessageIndex = 0; mPendingMessageExpectedLength = 0;