From 215d59e0e65f3079a7f13cf2beb64a6198609dc4 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 26 Sep 2025 20:27:56 +0200 Subject: [PATCH] RegionFX: handle property and non-automatable controls This fixes crashes in recent LSP.lv2 and similar plugins. --- libs/ardour/region_fx_plugin.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/libs/ardour/region_fx_plugin.cc b/libs/ardour/region_fx_plugin.cc index 59f2d4b4d2..bbac230f23 100644 --- a/libs/ardour/region_fx_plugin.cc +++ b/libs/ardour/region_fx_plugin.cc @@ -593,6 +593,9 @@ RegionFxPlugin::set_default_automation (timepos_t end) { for (auto const& i : _controls) { std::shared_ptr ac = std::dynamic_pointer_cast (i.second); + if (!ac->alist ()) { + continue; + } if (ac->alist ()->empty ()) { ac->alist ()->fast_simple_add (timepos_t (time_domain ()), ac->normal ()); ac->alist ()->fast_simple_add (end, ac->normal ()); @@ -807,7 +810,9 @@ RegionFxPlugin::flush () } for (auto const& i : _controls) { shared_ptr tpc = std::dynamic_pointer_cast(i.second); - tpc->flush (); + if (tpc) { + tpc->flush (); + } } } @@ -1448,7 +1453,7 @@ RegionFxPlugin::connect_and_run (BufferSet& bufs, samplepos_t start, samplepos_t for (auto const& i : _controls) { shared_ptr tpc = std::dynamic_pointer_cast(i.second); - if (tpc->automation_playback ()) { + if (tpc && tpc->automation_playback ()) { tpc->store_value (start + pos, end + pos); } } @@ -1480,7 +1485,7 @@ RegionFxPlugin::maybe_emit_changed_signals () const Glib::Threads::Mutex::Lock lp (_process_lock); for (auto const& i : _controls) { shared_ptr tpc = std::dynamic_pointer_cast(i.second); - if (tpc->automation_playback ()) { + if (tpc && tpc->automation_playback ()) { tpc->maybe_emit_changed (); } }