From 4cb04e606f85c5dd69129bf463b4f1cb9155c5c2 Mon Sep 17 00:00:00 2001 From: Atsushi Eno Date: Sun, 29 Sep 2024 15:04:15 +0900 Subject: [PATCH] Fix VST3 assertion condition on set_io_mode() (must be before "initialize") From VST3 documentation on IComponent initialization https://steinbergmedia.github.io/vst3_dev_portal/pages/Technical+Documentation/API+Documentation/Index.html : > Hosts should not call other functions before initialize is called, with > the sole exception of Steinberg::Vst::IComponent::setIoMode which must > be called before initialize. --- distrho/src/DistrhoPluginVST3.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/distrho/src/DistrhoPluginVST3.cpp b/distrho/src/DistrhoPluginVST3.cpp index c1f2ae4d..3e8d2f1e 100644 --- a/distrho/src/DistrhoPluginVST3.cpp +++ b/distrho/src/DistrhoPluginVST3.cpp @@ -4459,7 +4459,8 @@ struct dpf_component : v3_component_cpp { dpf_component* const component = *static_cast(self); PluginVst3* const vst3 = component->vst3; - DISTRHO_SAFE_ASSERT_RETURN(vst3 != nullptr, V3_NOT_INITIALIZED); + // It must be called *before* "initialize". + DISTRHO_SAFE_ASSERT_RETURN(vst3 == nullptr, V3_NOT_INITIALIZED); // TODO return V3_NOT_IMPLEMENTED;