From cd48a9f0075d99be38370318ccc35aca8d09ef95 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Mon, 15 Dec 2025 16:28:42 +0100 Subject: [PATCH 1/2] fix for #1477 - sanity check to correct position --- lib_com/options.h | 1 + lib_dec/dec_acelp.c | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 59daf40a86..6449c39074 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -162,6 +162,7 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ #define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */ #define NONBE_1122_KEEP_EVS_MODE_UNCHANGED /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR. */ +#define FIX_1477_OOB_INDEX_IN_D_ACELP_INDEXING /* FhG: fix oob indexing */ /* #################### End BE switches ################################## */ diff --git a/lib_dec/dec_acelp.c b/lib_dec/dec_acelp.c index 6c2c1ba6c8..4ebca19066 100644 --- a/lib_dec/dec_acelp.c +++ b/lib_dec/dec_acelp.c @@ -171,6 +171,7 @@ void D_ACELP_indexing( } s = index_n[0]; pulses = pulsestrack[0]; +#ifndef FIX_1477_OOB_INDEX_IN_D_ACELP_INDEXING /* safety check in case of bit errors */ if ( s >= pulsestostates[16][pulses - 1] ) { @@ -178,8 +179,18 @@ void D_ACELP_indexing( *BER_detect = 1; return; } +#endif if ( pulses ) { +#ifndef FIX_1477_OOB_INDEX_IN_D_ACELP_INDEXING + /* safety check in case of bit errors */ + if ( s >= pulsestostates[16][pulses - 1] ) + { + set_f( code, 0.0f, L_SUBFR ); + *BER_detect = 1; + return; + } +#endif D_ACELP_decode_arithtrack( code, s, pulses, num_tracks, 16 ); } else -- GitLab From 3378425a339394c18d236677339ec63d50c19fe2 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Mon, 15 Dec 2025 17:12:55 +0100 Subject: [PATCH 2/2] fix ifndef -> ifdef --- lib_dec/dec_acelp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_dec/dec_acelp.c b/lib_dec/dec_acelp.c index 4ebca19066..effde604f8 100644 --- a/lib_dec/dec_acelp.c +++ b/lib_dec/dec_acelp.c @@ -182,7 +182,7 @@ void D_ACELP_indexing( #endif if ( pulses ) { -#ifndef FIX_1477_OOB_INDEX_IN_D_ACELP_INDEXING +#ifdef FIX_1477_OOB_INDEX_IN_D_ACELP_INDEXING /* safety check in case of bit errors */ if ( s >= pulsestostates[16][pulses - 1] ) { -- GitLab