From 8cca2d690d0017ef0ca0e2b35a89ff0bae1296ec Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Fri, 12 Dec 2025 16:36:31 +0100 Subject: [PATCH] fix for #2274 --- lib_com/options.h | 1 + lib_enc/enc_acelp_fx.c | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index ee8c6be3a..ea6a2cc0e 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -89,6 +89,7 @@ #define FIX_2252_SCALING_SAVE_HB_SYNTH /* VA: issue 2252: fix use-of-uninit-value in save_hb_synth_fx[] scaling in FOA decoding with bitstream that starts with an SID */ #define FIX_2248_EVS_ASSERT /* VA: Include _sat in an EVS related part of the code */ #define FIX_2254_IMPROV_COMPLEXITY_BE /* VA: BE small complexity reduction */ +#define FIX_2274_OOB_INDEXING_IN_CORRMATRIX /* FhG: fix OOB indexing complaint */ /* #################### End BE switches ################################## */ diff --git a/lib_enc/enc_acelp_fx.c b/lib_enc/enc_acelp_fx.c index bdbc32fec..626d89aaa 100644 --- a/lib_enc/enc_acelp_fx.c +++ b/lib_enc/enc_acelp_fx.c @@ -997,7 +997,14 @@ void E_ACELP_corrmatrix_fx( p3 = &rrixiy[2][pos]; /* Q9 */ p2 = &rrixiy[1][pos]; p1 = &rrixiy[0][pos]; +#ifdef FIX_2274_OOB_INDEXING_IN_CORRMATRIX + p0 = &rrixiy[3][pos]; + /* decrement pointer instead of indexing the array to avoid CLANG Usan complaint */ + /* for last loop iteration, this points to rrixiy[3][-1], but is not actually accessed in later loop (k = 15 then, so inner loop will not run) */ + p0 -= 16; +#else p0 = &rrixiy[3][pos - 16]; +#endif cor = L_deposit_h( 0 ); ptr_h1 = h; /*Q12*/ -- GitLab