fix potential segfault
This commit is contained in:
parent
889ece8080
commit
1cd27b1c68
1 changed files with 3 additions and 1 deletions
|
@ -35,7 +35,7 @@ typedef struct {
|
||||||
|
|
||||||
personal data;
|
personal data;
|
||||||
#if (PARAMETERS > 0)
|
#if (PARAMETERS > 0)
|
||||||
float *values[PARAMETERS];
|
LADSPA_Data *values[PARAMETERS];
|
||||||
param params[PARAMETERS];
|
param params[PARAMETERS];
|
||||||
#endif
|
#endif
|
||||||
} plug_t;
|
} plug_t;
|
||||||
|
@ -100,6 +100,8 @@ plug_process(LADSPA_Handle instance, unsigned long count)
|
||||||
plug_t *plug = (plug_t *)instance;
|
plug_t *plug = (plug_t *)instance;
|
||||||
#if (PARAMETERS > 0)
|
#if (PARAMETERS > 0)
|
||||||
for (int i = 0; i < PARAMETERS; i++) {
|
for (int i = 0; i < PARAMETERS; i++) {
|
||||||
|
if (!plug->values[i])
|
||||||
|
continue;
|
||||||
if (*plug->values[i] != plug->params[i].value) {
|
if (*plug->values[i] != plug->params[i].value) {
|
||||||
plug->params[i].value = *plug->values[i];
|
plug->params[i].value = *plug->values[i];
|
||||||
adjust_one(&plug->data, plug->params, i);
|
adjust_one(&plug->data, plug->params, i);
|
||||||
|
|
Loading…
Reference in a new issue