diff options
author | Chris Robinson <[email protected]> | 2018-03-22 11:11:45 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-03-22 11:11:45 -0700 |
commit | 6685e0a078a3bf6a42bac8eff9629536e46278eb (patch) | |
tree | 605f9b44ee1599cd91b37bc3ecfbf0b2cfc79b8f /Alc/effects/pshifter.c | |
parent | 7789cc8e32f71201a603809484031fe9988258c1 (diff) |
Don't use an ALsizei for a potentially negative value
Diffstat (limited to 'Alc/effects/pshifter.c')
-rw-r--r-- | Alc/effects/pshifter.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Alc/effects/pshifter.c b/Alc/effects/pshifter.c index 33c3e121..42228617 100644 --- a/Alc/effects/pshifter.c +++ b/Alc/effects/pshifter.c @@ -309,6 +309,7 @@ static ALvoid ALpshifterState_process(ALpshifterState *state, ALsizei SamplesToD { ALphasor component; ALfloat tmp; + ALint qpd; /* Compute amplitude and phase */ component = rect2polar(state->FFTbuffer[k]); @@ -317,8 +318,8 @@ static ALvoid ALpshifterState_process(ALpshifterState *state, ALsizei SamplesToD tmp = (component.Phase - state->LastPhase[k]) - (ALfloat)k*expected; /* Map delta phase into +/- Pi interval */ - j = fastf2i(tmp / F_PI); - tmp -= F_PI * (ALfloat)(j + (j%2)); + qpd = fastf2i(tmp / F_PI); + tmp -= F_PI * (ALfloat)(qpd + (qpd%2)); /* Get deviation from bin frequency from the +/- Pi interval */ tmp /= expected; |