diff options
author | Chris Robinson <chris.kcat@gmail.com> | 2018-01-11 09:53:52 -0800 |
---|---|---|
committer | Chris Robinson <chris.kcat@gmail.com> | 2018-01-11 09:53:52 -0800 |
commit | ca9e6a4f9434ca25f821802d1b6e1363b18d7b81 (patch) | |
tree | a0fc9dace8d98b8278260c7015391e0cdcf90273 /Alc/effects/chorus.c | |
parent | b11131ce0c76d2b46208ad5473dd86dc5343ce5f (diff) |
Ensure NextPowerOf2 is being used correctly
Diffstat (limited to 'Alc/effects/chorus.c')
-rw-r--r-- | Alc/effects/chorus.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Alc/effects/chorus.c b/Alc/effects/chorus.c index 9be69f92..901c1157 100644 --- a/Alc/effects/chorus.c +++ b/Alc/effects/chorus.c @@ -98,8 +98,8 @@ static ALboolean ALchorusState_deviceUpdate(ALchorusState *state, ALCdevice *Dev const ALfloat max_delay = maxf(AL_CHORUS_MAX_DELAY, AL_FLANGER_MAX_DELAY); ALsizei maxlen; - maxlen = fastf2i(max_delay * 2.0f * Device->Frequency) + 1; - maxlen = NextPowerOf2(maxlen); + maxlen = NextPowerOf2(fastf2i(max_delay*2.0f*Device->Frequency) + 1); + if(maxlen <= 0) return AL_FALSE; if(maxlen != state->BufferLength) { |