diff --git a/lib_com/options.h b/lib_com/options.h index f77c3ffa4d81526fd2a44b07d8dd63308212ae46..e0435b3e26303e179da436a2527d3a4c5c9565c6 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_CLANG18_MSAN_IN_DEC_INIT_BY_MOVING_COMMON_INITS_TOGETHER /* FhG: fix CLANG18 MSAN error in decoder init */ #define FIX_1481_CLANG18_MSAN_INIT_LAST_ELEM_BRATE /* FhG: initialize last_element_brate to avoid CLANG18 MSAN complaint */ #define FIX_1484_CLANG18_MSAN_INIT_ST_ELEM_BRATE /* FhG: initialize st->element_brate per default */ #define FIX_1464_UBSAN_RC_CONTEXT_MAP /* FhG: BE UBSAN fix for float issue 1464 in the TCX range coder */ diff --git a/lib_dec/lib_dec_fx.c b/lib_dec/lib_dec_fx.c index 0bc064d05f677a71a64d3b0f18c1f4f242dad926..26f0f52e7a73bad81a49c2c6c4a1a50517478310 100644 --- a/lib_dec/lib_dec_fx.c +++ b/lib_dec/lib_dec_fx.c @@ -232,43 +232,56 @@ ivas_error IVAS_DEC_Open( move16(); /* set high-level parameters */ +#ifdef FIX_CLANG18_MSAN_IN_DEC_INIT_BY_MOVING_COMMON_INITS_TOGETHER + st_ivas->codec_mode = 0; /* unknown before first frame */ + st_ivas->transport_config = IVAS_AUDIO_CONFIG_INVALID; + st_ivas->intern_config = IVAS_AUDIO_CONFIG_INVALID; + st_ivas->writeFECoffset = 0; + st_ivas->sba_analysis_order = 0; /* not really used in EVS mode, but initialize here to fix MSAN complaint */ + move16(); + move16(); + move16(); + move16(); + move16(); + +#endif IF( EQ_16( mode, IVAS_DEC_MODE_EVS ) ) { +#ifndef FIX_CLANG18_MSAN_IN_DEC_INIT_BY_MOVING_COMMON_INITS_TOGETHER st_ivas->codec_mode = 0; /* unknown before first frame */ - st_ivas->element_mode_init = EVS_MONO; - st_ivas->ivas_format = MONO_FORMAT; st_ivas->transport_config = IVAS_AUDIO_CONFIG_INVALID; st_ivas->intern_config = IVAS_AUDIO_CONFIG_INVALID; st_ivas->writeFECoffset = 0; +#endif + st_ivas->element_mode_init = EVS_MONO; + st_ivas->ivas_format = MONO_FORMAT; hIvasDec->hasDecodedFirstGoodFrame = true; /* Functionality to suppress output for initial lost frames is disabled in EVS operation */ move16(); move16(); move16(); - move16(); - move16(); - move16(); - move16(); return IVAS_ERR_OK; } ELSE IF( EQ_16( mode, IVAS_DEC_MODE_IVAS ) ) { +#ifndef FIX_CLANG18_MSAN_IN_DEC_INIT_BY_MOVING_COMMON_INITS_TOGETHER st_ivas->codec_mode = 0; /* unknown before first frame */ - st_ivas->element_mode_init = -1; - st_ivas->ivas_format = UNDEFINED_FORMAT; st_ivas->transport_config = IVAS_AUDIO_CONFIG_INVALID; st_ivas->intern_config = IVAS_AUDIO_CONFIG_INVALID; + st_ivas->writeFECoffset = 0; + st_ivas->sba_analysis_order = 0; +#endif + st_ivas->element_mode_init = -1; + st_ivas->ivas_format = UNDEFINED_FORMAT; st_ivas->renderer_type = RENDERER_DISABLE; st_ivas->ini_frame = 0; st_ivas->ini_active_frame = 0; - st_ivas->writeFECoffset = 0; st_ivas->ism_mode = ISM_MODE_NONE; st_ivas->mc_mode = MC_MODE_NONE; st_ivas->sba_order = 0; st_ivas->sba_planar = 0; - st_ivas->sba_analysis_order = 0; move16(); move16(); @@ -279,11 +292,6 @@ ivas_error IVAS_DEC_Open( move16(); move16(); move16(); - move16(); - move16(); - move16(); - move16(); - move16(); return IVAS_ERR_OK; }