develop ← emezeske:pr/lv2-optional-audio-ports
opened 04:40AM - 01 Oct 26 UTC
An LV2 plugin built with JUCE segfaults in run() when the host leaves one of its… optional audio ports unconnected.
I caught this running pluginval on our LV2 build on Linux. It passes everything up to the Audio processing test and then crashes. To repro, take a plugin with an input bus beyond the main one (ours has extra input buses after the main stereo pair) and run `pluginval --strictness-level 10 --validate YourPlugin.lv2`. It dies in memcpy under LV2PluginInstance::run(). The VST3 build of the same plugin passes.
The wrapper declares audio ports outside the main bus as lv2:connectionOptional, so the host is allowed to pass null for them, and pluginval does. run() copies from every input port without checking for null, and the suspended path fills every output port the same way. The output copy at the end of run() already skips null ports. This makes an unconnected input read as silence and skips an unconnected output in the suspended path too.