Possible bug in SysEx input code


I think there may be a bug in the sysex receive code in juce 1.43. I can receive SysEx messages just fine until I get one that is >128 bytes long. Then my [color=darkblue]handleIncomingMidiMessage [/color]override gets called with an incomplete message that’s always 128 bytes long (same as juce MIDI’s packet buffer size). Oddly, [color=darkblue]handlePartialSysexMessage[/color] never gets called at all in this scenario, which doesn’t seem to match the documentation. Has anyone successfully handled large sysex messages with juce?

Hmm. That code does look a bit old and creaky. Did you hit the assertion in juce_win32_Midi at line 158?

No. It just happily provides an incomplete message.

You’re sure you were running it in debug mode? It would certainly have asserted if the buffer overflowed…

Yes. It’s debug mode. Your Thread unhandled exception trap asserts when I throw an exception, so I assume the buffer overflow would assert too.

ah - ok, I think I see the problem. It’s splitting the message but not realising that it’s doing so. I’ll try to come up with a fix for that…

Cool! Thanks for being so responsive.