aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--alc/effects/pshifter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/alc/effects/pshifter.cpp b/alc/effects/pshifter.cpp
index 625edc92..6bdcb26b 100644
--- a/alc/effects/pshifter.cpp
+++ b/alc/effects/pshifter.cpp
@@ -137,7 +137,7 @@ void PshifterState::update(const ContextBase*, const EffectSlot *slot,
{
const int tune{props->Pshifter.CoarseTune*100 + props->Pshifter.FineTune};
const float pitch{std::pow(2.0f, static_cast<float>(tune) / 1200.0f)};
- mPitchShiftI = fastf2u(pitch*MixerFracOne);
+ mPitchShiftI = clampu(fastf2u(pitch*MixerFracOne), MixerFracHalf, MixerFracOne*2);
mPitchShift = mPitchShiftI * double{1.0/MixerFracOne};
static constexpr auto coeffs = CalcDirectionCoeffs({0.0f, 0.0f, -1.0f});