From 7808e0b92fdb7f84180553fa534d66b2f2f041c6 Mon Sep 17 00:00:00 2001 From: Johannes Lorenz Date: Sat, 24 Oct 2020 17:24:40 +0200 Subject: [PATCH] Lv2 Fix invalid memory access if plugin did not load --- src/core/lv2/Lv2Proc.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/core/lv2/Lv2Proc.cpp b/src/core/lv2/Lv2Proc.cpp index 0922ac242ed..925dca5bd0c 100644 --- a/src/core/lv2/Lv2Proc.cpp +++ b/src/core/lv2/Lv2Proc.cpp @@ -396,9 +396,12 @@ void Lv2Proc::initPlugin() void Lv2Proc::shutdownPlugin() { - lilv_instance_deactivate(m_instance); - lilv_instance_free(m_instance); - m_instance = nullptr; + if (m_valid) + { + lilv_instance_deactivate(m_instance); + lilv_instance_free(m_instance); + m_instance = nullptr; + } }