Skip to content

Commit

Permalink
Division with 0 in calf limiter
Browse files Browse the repository at this point in the history
  • Loading branch information
zonkmachine committed Oct 30, 2017
1 parent fb48539 commit b58e3dd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions plugins/LadspaEffect/calf/src/audio_fx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,7 @@ void lookahead_limiter::process(float &left, float &right, float * multi_buffer)
_peak = fabs(buffer[nextpos[j]]) > fabs(buffer[nextpos[j] + 1]) ? fabs(buffer[nextpos[j]]) : fabs(buffer[nextpos[j] + 1]);
// calc a delta to use to reach our incoming peak from the
// stored position
_peak = fmaxf( 0.0000001, _peak );
_delta = (_limit / peak - (limit * _multi_coeff * weight) / _peak) / (((buffer_size - nextpos[j] + pos) % buffer_size) / channels);
if(_delta < nextdelta[j]) {
// if the buffered delta is more important than the delta
Expand Down

0 comments on commit b58e3dd

Please sign in to comment.