JUCE Assertion failure in juce_MidiDataConcatenator.h:99


Sometimes when I start my application, I get an assertion failure in juce_MidiDataConcatenator.h line 99. The assert is: jassert (used == len);. It only seems to happen when I have a MIDI device connected. Here are the values of the variables when it breaks at the jassert:

If I log the first 16 bytes of memory at address d (a local uint8*), this is what I get:


If I print data, it is:

(uint8 [3]) $17 = ([0] = '\xcf', [1] = '7', [2] = '\v')

I don’t know if it’s possible to find the problem with this information at all, but I thought it would be good to at least report it.
It only happens occasionally, so I can’t reproduce it. And when it breaks at the jassert, it’s too late: I can’t see what the control flow was before that.


It’s basically saying that the data’s length isn’t consistent with the length of the midi message it contains - usually a corrupted or malformed midi packet from a device. Whether that matters to you largely depends on whether you can ignore damaged packets or not in your app.


Ok, thanks for the info! It’s not a problem then.