From 55ef90d1cd6bcf5102ccb73f374d261ae423bd9b Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Thu, 18 Dec 2025 14:34:41 +0100 Subject: [PATCH 1/2] Add FIX_1480_CLANG18_MSAN_UNINIT_VARIABLE to resolve clang-18 MSAN error --- lib_com/options.h | 1 + lib_dec/hq_hr_dec_fx.c | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index d7daa9187..59d189d63 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -103,6 +103,7 @@ #define FIX_1904_HARM_GSC_ENC /* VA: #1904 Harmonization of EVS and IVAS GSC code */ #define FIX_2271_OOB_INDEXING_IN_PIT_OL2 /* VA: Fix for issue 2271, to silence clang18 */ #define FIX_2273_OOB_INDEXING_IN_PIT_FR4 /* VA: Fix to silence clang on ptr init */ +#define FIX_1480_CLANG18_MSAN_UNINIT_VARIABLE /* Eri: Initializes two variables in HQ decoder. They are not used, but they are passed uninitialized to a function which is caught by clang-18 */ /* #################### End BE switches ################################## */ diff --git a/lib_dec/hq_hr_dec_fx.c b/lib_dec/hq_hr_dec_fx.c index 0d342ba2d..93fd8d63a 100644 --- a/lib_dec/hq_hr_dec_fx.c +++ b/lib_dec/hq_hr_dec_fx.c @@ -166,7 +166,12 @@ void ivas_hq_hr_dec_fx( Word16 csw_flag1, csw_flag2; HQ_DEC_HANDLE hHQ_core = st_fx->hHQ_core; - +#ifdef FIX_1480_CLANG18_MSAN_UNINIT_VARIABLE + SWB_fenv = NULL; /* Init in case HQ_GEN_SWB/HQ_GEN_FB is not used -- eliminates runtime warning when passed to fill_spectrum */ + hq_generic_offset = 0; + move16(); + move16(); +#endif move16(); move16(); -- GitLab From 157aff60581f3fcf74ff41ba98e0d261db491e97 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Thu, 18 Dec 2025 15:59:21 +0100 Subject: [PATCH 2/2] Fix wrong init of SWB_fenv --- lib_dec/hq_hr_dec_fx.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib_dec/hq_hr_dec_fx.c b/lib_dec/hq_hr_dec_fx.c index 93fd8d63a..975b643a4 100644 --- a/lib_dec/hq_hr_dec_fx.c +++ b/lib_dec/hq_hr_dec_fx.c @@ -167,10 +167,8 @@ void ivas_hq_hr_dec_fx( HQ_DEC_HANDLE hHQ_core = st_fx->hHQ_core; #ifdef FIX_1480_CLANG18_MSAN_UNINIT_VARIABLE - SWB_fenv = NULL; /* Init in case HQ_GEN_SWB/HQ_GEN_FB is not used -- eliminates runtime warning when passed to fill_spectrum */ hq_generic_offset = 0; move16(); - move16(); #endif move16(); move16(); -- GitLab