Bugreport for the latest version of JUCE

I believe I found a bug in the latest version of JUCE which seems to have been already in somewhat earlier versions too:

Calling the below method:
midiBuffer->addEvent(juce::MidiMessage::programChange(midiChannel, patchNumber), startSample);

…causes an assertion failure in juce_MidiMessage.cpp line 169 in constructor:
MidiMessage::MidiMessage (const int byte1, const int byte2, const int byte3, const double t) noexcept

The construcor is called via:
MIDITimer::hiResTimerCallback()

…which in turn calls:
void MIDITimerOutputDevice_Impl::sendBufferedMIDIMessages(const double current_time_ms)

…which eventually lead to calling that MidiMessage constructor with the assertion in it.

I believe the program change message is 2 bytes long and the above MidiMessage’s assertion probably assumes it should be 3 bytes long.

Also another bug is that for some reason with this latest version of JUCE, when I press my computer keyboard (on Mac platform at least), I hear the sound effect (“Plim!”) MacOS makes when the keys are not processed for some reason, even though the keyboard presses seem to be registered correctly by my code.

I did’t change anything from my code. All I did was get the latest version of JUCE and this started happening.