From 862d475b2b6afb40031ae3dce34a435c5fbd11da Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Mon, 25 Jul 2022 16:43:15 +0200 Subject: [PATCH] Prevent divisions by zero in sidechain mode --- plugins/spectral_compressor/src/compressor_bank.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/spectral_compressor/src/compressor_bank.rs b/plugins/spectral_compressor/src/compressor_bank.rs index 153fd519..16c4dfee 100644 --- a/plugins/spectral_compressor/src/compressor_bank.rs +++ b/plugins/spectral_compressor/src/compressor_bank.rs @@ -728,7 +728,9 @@ impl CompressorBank { unsafe { magnitudes.get_unchecked(bin_idx) * t } }) - .sum(); + .sum::() + // The thresholds may never reach zero as they are used in divisions + .max(f32::EPSILON); let mut scale = 1.0;