diff --git a/src/BLEMIDI_Transport.h b/src/BLEMIDI_Transport.h index bc2b2de..a48fa3e 100644 --- a/src/BLEMIDI_Transport.h +++ b/src/BLEMIDI_Transport.h @@ -299,7 +299,7 @@ class BLEMIDI_Transport // Point to next non-data byte rPtr = lPtr; - while ((buffer[rPtr + 1] < MIDI_TYPE) && (rPtr < (length - 1))) + while ((rPtr < (length - 1)) && (buffer[rPtr + 1] < MIDI_TYPE)) rPtr++; if (!runningStatusContinuation)