Skip to content

Commit

Permalink
Replace isInitialByte() check with isStatusByte() in MidiDataConcaten…
Browse files Browse the repository at this point in the history
…ator::processSysex() to fix truncated sysex messages
  • Loading branch information
ed95 committed Mar 19, 2019
1 parent ff1dbf5 commit 291d654
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions modules/juce_audio_devices/native/juce_MidiDataConcatenator.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class MidiDataConcatenator

do
{
if (pendingSysexSize > 0 && isInitialByte (*d))
if (pendingSysexSize > 0 && isStatusByte (*d))
{
if (*d == 0xf7)
{
Expand Down Expand Up @@ -172,7 +172,8 @@ class MidiDataConcatenator
}

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;
Expand Down

0 comments on commit 291d654

Please sign in to comment.