From c820c11d6727b7b14d491201b9b286a87de26c8c Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Fri, 27 Feb 2026 16:39:43 +0100 Subject: [PATCH] fix MSAN error in AMR-WB code when bitstream starts with an SID --- lib_com/options.h | 1 + lib_dec/hf_synth_fx.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 20cc81e20..11248c56e 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -98,6 +98,7 @@ #define FIX_2431_AVOID_CALLOC /* VA: basp issue 2431: avoid use of calloc() */ #define FIX_2424_REMOVE_GAUSS_L2_ENC /* VA: basop issue 2424: Remove duplicated code in gauss_L2_ivas_fx() */ #define FIX_MDCT_STEREO_ENC_STACK /* VA: basop issue 2428: Move IGF temporary buffers out of the highest stack */ +#define FIX_2459_USAN_AMR_SIDSTART /* FhG: basop issue 2459: fix msan complaint */ /* #################### End BE switches ################################## */ diff --git a/lib_dec/hf_synth_fx.c b/lib_dec/hf_synth_fx.c index 7b1124d58..99656ace0 100644 --- a/lib_dec/hf_synth_fx.c +++ b/lib_dec/hf_synth_fx.c @@ -994,6 +994,14 @@ void hf_synth_amr_wb_fx( move16(); /* qdct */ pt1++; } +#ifdef FIX_2459_USAN_AMR_SIDSTART + + /* initialize to fix MSAN complaint - array is never actually accessed in this case */ + FOR( i = 0; i < NB_SUBFR; i++ ) + { + HF_corr_gain[i] = 32767; /* one in Q15 */ + } +#endif } q_tmp = Exp16Array( L_FRAME16k, dct_hb ); -- GitLab