From 6d0181b7ce71380201d5099d2829e1a592978a6f Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Fri, 12 Dec 2025 15:46:02 +0100 Subject: [PATCH] use proper IF/ELSE construct sideeffect: avoids sanitizer complaint --- lib_com/options.h | 1 + lib_com/tcx_ltp_fx.c | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index ee8c6be3a..a29629e00 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_2275_OOB_INDEXING_IN_PREDICT_SIGNAL_FUNC /* FhG: fix a USAN OOB error */ /* #################### End BE switches ################################## */ diff --git a/lib_com/tcx_ltp_fx.c b/lib_com/tcx_ltp_fx.c index 4eb334205..1ecc8b766 100644 --- a/lib_com/tcx_ltp_fx.c +++ b/lib_com/tcx_ltp_fx.c @@ -401,9 +401,20 @@ void predict_signal( x0--; } +#ifdef FIX_2275_OOB_INDEXING_IN_PREDICT_SIGNAL_FUNC + IF( EQ_16( frac_max, 6 ) ) + { + win = &inter6_2tcx2[frac][0]; /* Q15 */ + } + ELSE + { + win = &inter4_2tcx2[frac][0]; /* Q15 */ + } +#else win = &inter4_2tcx2[frac][0]; /* Q15 */ if ( EQ_16( frac_max, 6 ) ) win = &inter6_2tcx2[frac][0]; /* Q15 */ +#endif FOR( j = 0; j < L_subfr; j++ ) { -- GitLab