From c1e286629fe4acbc8e9980075397e25f589bdd4d Mon Sep 17 00:00:00 2001 From: Tom M Date: Mon, 23 Aug 2021 20:04:44 +0200 Subject: [PATCH] Fix NULL deref in delete_fluid_ladspa_effect() (#963) --- src/bindings/fluid_ladspa.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/bindings/fluid_ladspa.c b/src/bindings/fluid_ladspa.c index bb63e5b8..4acb75fc 100644 --- a/src/bindings/fluid_ladspa.c +++ b/src/bindings/fluid_ladspa.c @@ -1325,13 +1325,16 @@ static void delete_fluid_ladspa_effect(fluid_ladspa_effect_t *effect) * are private to this effect, so we can safely remove them here. Nodes connected * to audio ports might be connected to other effects as well, so we simply remove * any pointers to them from the effect. */ - for(i = 0; i < effect->desc->PortCount; i++) + if(effect->desc != NULL) { - node = (fluid_ladspa_node_t *) effect->port_nodes[i]; - - if(node && node->type & FLUID_LADSPA_NODE_CONTROL) + for(i = 0; i < effect->desc->PortCount; i++) { - delete_fluid_ladspa_node(node); + node = (fluid_ladspa_node_t *) effect->port_nodes[i]; + + if(node && node->type & FLUID_LADSPA_NODE_CONTROL) + { + delete_fluid_ladspa_node(node); + } } }