From 40849c3fa91081ee733c61f89b0f6664c4d6d6bc Mon Sep 17 00:00:00 2001 From: Antoine SOULIER Date: Fri, 22 Apr 2022 10:54:44 +0200 Subject: [PATCH] fix: Bad array access when LTPF filter disabled --- src/ltpf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ltpf.c b/src/ltpf.c index 4c81849..bd6b11a 100644 --- a/src/ltpf.c +++ b/src/ltpf.c @@ -614,7 +614,7 @@ void lc3_ltpf_synthesize(enum lc3_dt dt, enum lc3_srate sr, int nbytes, for (int i = 0; i < w; i++) { float g = active ? 0.4f - 0.05f * g_idx : 0; c[ i] = g * lc3_ltpf_cden[sr][pitch & 3][(w-1)-i]; - c[w+i] = 0.85f * g * lc3_ltpf_cnum[sr][g_idx][(w-1)-i]; + c[w+i] = 0.85f * g * lc3_ltpf_cnum[sr][LC3_MIN(g_idx, 3)][(w-1)-i]; } /* --- Transition handling --- */