From 2f676832bcd4aa9a51a602eb254e60eb831581dc Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Wed, 4 Sep 2013 15:46:05 -0700 Subject: Avoid a divide-by-0 when distortion edge is 1 --- Alc/effects/distortion.c | 1 + 1 file changed, 1 insertion(+) 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 */ -- cgit v1.2.3