When running Juce plugin host, and working with VST3 plugins with multiple channels.
It is possible that the getJuceChannelForVst3Channel returns -1 if the channel is not found.
This then leads to a crash in getVst3LayoutForJuceBuffer (juce_VST3Common.h) as it tries to do this:
buffer.getWritePointer (channelStartOffset + busMap.getJuceChannelForVst3Channel ((int) I)
with the “-1” it got from getJuceChannelForVst3Channel. this will then crash.
So could we please guard against the -1?
Maybe this is an edge case, and my real problem is probably something else. I don’t know why it returns -1 but it seems like something that could fail more gracefully.