commit 05fb681ca20f9489e2ec5c8a59222773fd7265d3
parent e82d466538bed4617198be34b8274cbf742252b3
Author: fundamental <mark.d.mccurry@gmail.com>
Date: Fri, 12 Nov 2021 20:26:43 -0500
Avoid out-of-bounds filter type for moog vis
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/src/Params/FilterParams.cpp b/src/Params/FilterParams.cpp
@@ -217,6 +217,9 @@ const rtosc::Ports FilterParams::ports = {
float gain = dB2rap(obj->getgain());
if(obj->Ptype != 6 && obj->Ptype != 7 && obj->Ptype != 8)
gain = 1.0;
+ int tmp = 4-obj->Ptype;
+ if(tmp < 0 || tmp > 8)
+ return;
auto cf = AnalogFilter::computeCoeff(4-obj->Ptype,
Filter::getrealfreq(obj->getfreq()),
obj->getq(), obj->Pstages,