In the method makePresetsFile(), the variable i is used to loop over every preset which is being saved. Variable j is used in an inner loop to loop over plugin parameters. However, the array params was being accessed using i as an index, rather than j.
If you have, e.g. 4 presets for a plugin that accepts 2 parameters, the previous code tries to access params[2] and params[3], which are out of bounds because there are only 2 parameters. This was leading to segfaults when I built the Bulgroz and Castafiore plugins.
In the method
makePresetsFile()
, the variablei
is used to loop over every preset which is being saved. Variablej
is used in an inner loop to loop over plugin parameters. However, the arrayparams
was being accessed usingi
as an index, rather thanj
.If you have, e.g. 4 presets for a plugin that accepts 2 parameters, the previous code tries to access
params[2]
andparams[3]
, which are out of bounds because there are only 2 parameters. This was leading to segfaults when I built the Bulgroz and Castafiore plugins.