summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Zammit <damien@zamaudio.com>2022-12-12 21:04:56 +1100
committerDamien Zammit <damien@zamaudio.com>2022-12-12 21:04:56 +1100
commite328e01dbdf2e71331dcf527534d8949023b4d67 (patch)
treefd8cb45bce59bde3c8870929984f9bcedd01b708
parent66c24a2e26d72dc0c3f1df85f335a069dc860bea (diff)
ZamVerb: Fix uninitialised values
-rw-r--r--plugins/ZamVerb/ZamVerbPlugin.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/plugins/ZamVerb/ZamVerbPlugin.cpp b/plugins/ZamVerb/ZamVerbPlugin.cpp
index 8e777b0..a625f6f 100644
--- a/plugins/ZamVerb/ZamVerbPlugin.cpp
+++ b/plugins/ZamVerb/ZamVerbPlugin.cpp
@@ -26,9 +26,10 @@ ZamVerbPlugin::ZamVerbPlugin()
{
signal = false;
swap = 0;
- clv[swap] = new LV2convolv();
- clv[swap]->clv_configure("convolution.ir.preset", "0");
- clv[swap]->clv_initialize(getSampleRate(), 2, 2, getBufferSize());
+ active = 0;
+ clv[0] = new LV2convolv();
+ clv[0]->clv_configure("convolution.ir.preset", "0");
+ clv[0]->clv_initialize(getSampleRate(), 2, 2, getBufferSize());
clv[1] = new LV2convolv();
clv[1]->clv_configure("convolution.ir.preset", "0");
@@ -36,13 +37,13 @@ ZamVerbPlugin::ZamVerbPlugin()
// Extra buffer for outputs since plugin can work in place
tmpouts = (float **)malloc (2 * sizeof(float*));
- tmpouts[0] = (float *)malloc (8192 * sizeof(float));
- tmpouts[1] = (float *)malloc (8192 * sizeof(float));
+ tmpouts[0] = (float *)calloc (1, 8192 * sizeof(float));
+ tmpouts[1] = (float *)calloc (1, 8192 * sizeof(float));
// Extra buffer for inputs since convolve might clobber ins
tmpins = (float **)malloc (2 * sizeof(float*));
- tmpins[0] = (float *)malloc (8192 * sizeof(float));
- tmpins[1] = (float *)malloc (8192 * sizeof(float));
+ tmpins[0] = (float *)calloc (1, 8192 * sizeof(float));
+ tmpins[1] = (float *)calloc (1, 8192 * sizeof(float));
// set default values
loadProgram(0);