From c701aa6f848007d0b64b6fd39e6a6ff847d4d6ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 2 Jul 2024 19:30:34 +0300 Subject: [PATCH] audioloudnorm: Fix limiter buffer index wraparound off-by-one for the last buffer Part-of: --- audio/audiofx/src/audioloudnorm/imp.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audio/audiofx/src/audioloudnorm/imp.rs b/audio/audiofx/src/audioloudnorm/imp.rs index 2703cf32..e2ab7645 100644 --- a/audio/audiofx/src/audioloudnorm/imp.rs +++ b/audio/audiofx/src/audioloudnorm/imp.rs @@ -753,7 +753,7 @@ impl State { // amount of samples the last frame is short to reach the correct read position. if next_frame_size < FRAME_SIZE { self.limiter_buf_index += FRAME_SIZE - next_frame_size; - if self.limiter_buf_index > self.limiter_buf.len() { + if self.limiter_buf_index >= self.limiter_buf.len() { self.limiter_buf_index -= self.limiter_buf.len(); } }