Commit 2a80bece authored by Jan Kiene's avatar Jan Kiene
Browse files

Merge branch...

Merge branch 'float-1482-clang18-msan-use-of-uninitialized-value-in-lib_dec-ivas_init_dec-c-2556-22' into 'main'

Resolve "[CLANG18] MSAN: use-of-uninitialized-value in lib_dec/ivas_init_dec.c:2556:22" - align to float

See merge request !2649
parents 43d20bae 4a987d45
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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 */
+23 −15
Original line number Diff line number Diff line
@@ -232,19 +232,30 @@ ivas_error IVAS_DEC_Open(
    move16();

    /* set high-level parameters */
    IF( EQ_16( mode, IVAS_DEC_MODE_EVS ) )
    {
#ifdef 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;
        hIvasDec->hasDecodedFirstGoodFrame = true; /* Functionality to suppress output for initial lost frames is disabled in EVS operation */
    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->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();
@@ -253,22 +264,24 @@ ivas_error IVAS_DEC_Open(
    }
    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;
    }