From 1cd27b1c68eb824fe3a15d71bab3674634963619 Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Thu, 19 Jun 2014 08:27:25 -0700 Subject: [PATCH] fix potential segfault --- template/ladspa.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/template/ladspa.c b/template/ladspa.c index 3c0cc21..b41dc17 100644 --- a/template/ladspa.c +++ b/template/ladspa.c @@ -35,7 +35,7 @@ typedef struct { personal data; #if (PARAMETERS > 0) - float *values[PARAMETERS]; + LADSPA_Data *values[PARAMETERS]; param params[PARAMETERS]; #endif } plug_t; @@ -100,6 +100,8 @@ plug_process(LADSPA_Handle instance, unsigned long count) plug_t *plug = (plug_t *)instance; #if (PARAMETERS > 0) for (int i = 0; i < PARAMETERS; i++) { + if (!plug->values[i]) + continue; if (*plug->values[i] != plug->params[i].value) { plug->params[i].value = *plug->values[i]; adjust_one(&plug->data, plug->params, i);