From 291d654ece4f76fcb57f3ea711f564ca16065994 Mon Sep 17 00:00:00 2001 From: ed Date: Tue, 19 Mar 2019 14:58:33 +0000 Subject: [PATCH] Replace isInitialByte() check with isStatusByte() in MidiDataConcatenator::processSysex() to fix truncated sysex messages --- .../juce_audio_devices/native/juce_MidiDataConcatenator.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/juce_audio_devices/native/juce_MidiDataConcatenator.h b/modules/juce_audio_devices/native/juce_MidiDataConcatenator.h index d8a1cbc847..6fbe67a3b8 100644 --- a/modules/juce_audio_devices/native/juce_MidiDataConcatenator.h +++ b/modules/juce_audio_devices/native/juce_MidiDataConcatenator.h @@ -116,7 +116,7 @@ private: do { - if (pendingSysexSize > 0 && isInitialByte (*d)) + if (pendingSysexSize > 0 && isStatusByte (*d)) { if (*d == 0xf7) { @@ -172,7 +172,8 @@ private: } static bool isRealtimeMessage (uint8 byte) { return byte >= 0xf8 && byte <= 0xfe; } - static bool isInitialByte (uint8 byte) { return byte >= 0x80 && byte != 0xf7; } + static bool isStatusByte (uint8 byte) { return byte >= 0x80; } + static bool isInitialByte (uint8 byte) { return isStatusByte (byte) && byte != 0xf7; } uint8 currentMessage[3]; int currentMessageLen = 0;