1
0
Fork 0

Prevent divisions by zero in sidechain mode

This commit is contained in:
Robbert van der Helm 2022-07-25 16:43:15 +02:00
parent f7201a0f58
commit 862d475b2b

View file

@ -728,7 +728,9 @@ impl CompressorBank {
unsafe { magnitudes.get_unchecked(bin_idx) * t }
})
.sum();
.sum::<f32>()
// The thresholds may never reach zero as they are used in divisions
.max(f32::EPSILON);
let mut scale = 1.0;