Ensure the max reverb update size is a multiple of 4

It's not an issue for the final mix, but if one loop has an unaligned count,
the next loop will have unaligned input and output buffer targets which can
crash the SSE mixers.
This commit is contained in:
Chris Robinson
2018-09-11 18:39:50 -07:00
parent b13396cce2
commit 99737469e2
+4 -2
View File
@@ -948,9 +948,11 @@ static ALvoid ALreverbState_update(ALreverbState *State, const ALCcontext *Conte
props->Reverb.ReflectionsGain*gain, props->Reverb.LateReverbGain*gain,
State);
/* Calculate the max update size from the smallest relevant delay. */
/* Calculate the max update size from the smallest relevant delay, ensuring
* the update size is a multiple of 4 for SIMD.
*/
State->MaxUpdate[1] = mini(MAX_UPDATE_SAMPLES,
mini(State->Early.Offset[0][1], State->Late.Offset[0][1])
mini(State->Early.Offset[0][1], State->Late.Offset[0][1])&~3
);
/* Determine if delay-line cross-fading is required. TODO: Add some fuzz