Possible bug in SysEx input code


#1

Hi,

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?


#2

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


#3

No. It just happily provides an incomplete message.


#4

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


#5

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.


#6

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…


#7

Cool! Thanks for being so responsive.


#8