diff options
author | Chris Robinson <[email protected]> | 2013-09-04 15:46:05 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2013-09-04 15:46:05 -0700 |
commit | 2f676832bcd4aa9a51a602eb254e60eb831581dc (patch) | |
tree | 06663f354d408b869e224baeaf16a9933211f2e8 | |
parent | 94884ed04b88697acd851f1b4ab492221b809ad6 (diff) |
Avoid a divide-by-0 when distortion edge is 1
-rw-r--r-- | Alc/effects/distortion.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Alc/effects/distortion.c b/Alc/effects/distortion.c index a1058415..dce0d64d 100644 --- a/Alc/effects/distortion.c +++ b/Alc/effects/distortion.c @@ -84,6 +84,7 @@ static ALvoid ALdistortionState_update(ALdistortionState *state, ALCdevice *Devi /* Store waveshaper edge settings */ edge = sinf(Slot->EffectProps.Distortion.Edge * (F_PI/2.0f)); + edge = minf(edge, 0.99f); state->edge_coeff = 2.0f * edge / (1.0f-edge); /* Lowpass filter */ |