diff --git a/lib_com/options.h b/lib_com/options.h index 24a8afca14acff7c80e0f2a98a2ea14233436f12..dec62b523c92816ea679a9c2d954a78e2b5f0ce4 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 */ #define FIX_2278_OOB_INDEXING_IN_CLOSED_LOOP_PIT_SEARCH /* FhG: fix oob indexing USAN complaint */ #define FIX_2287_MCT_MDCT_STEREO_DATA_MALLOC_SIZE /* FhG: correct allocation size for STEREO_MDCT_DEC_DATA struct */ diff --git a/lib_enc/enc_acelp_fx.c b/lib_enc/enc_acelp_fx.c index bdbc32fec52c796dd776d963b7e3c080382baba1..626d89aaaf8a6a38f47b93f54608e1626a4782fa 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*/