Commit c14667cd authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

Merge branch...

Merge branch 'basop-2397-clang18-msan-use-of-uninitialized-value-in-lib_dec-ivas_stereo_mdct_core_dec_fx-c-392-9' into 'main'

Resolve "[CLANG18] MSAN: use-of-uninitialized-value in lib_dec/ivas_stereo_mdct_core_dec_fx.c:392:9"

Closes #2397

See merge request !2778
parents 7098a0f8 54ac62a3
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -107,6 +107,7 @@
#define FIX_2383_INIT_Q_A_ITF                           /* FhG: Initialize Q_A_itf, to avoid reading of uninitialized memory in case ITF is not triggered */
#define FIX_2382_COPY_AQ_IN_MCT                         /* FhG: basop issue 2382: 2nd instance of prevent copying uninitialized values from Aq_fx[][] to Aq_fx_32[][] in TCX */
#define FIX_2391_INIT_HQ_GENERIC_OFFSET                 /* FhG/Eri: basop issue 2391: make sure hq_generic_offset is initialized inside hq_hr_dec_fx() */
#define FIX_2397_COPY_AQ_MDCT_CORE_BFI                  /* FhG: prevent copying of uninit memory in MDCT stereo core if bfi is set */
#define HARMONIZE_TBE                                   /* VA: harmonize core-coder TBE function duplications */

/* #################### End BE switches ################################## */
+5 −0
Original line number Diff line number Diff line
@@ -228,7 +228,12 @@ ivas_error ivas_mct_dec_fx(
        FOR( n = 0; n < CPE_CHANNELS; n++ )
        {
#ifdef FIX_2382_COPY_AQ_IN_MCT
#ifdef FIX_2397_COPY_AQ_MDCT_CORE_BFI
            test();
            IF( !st_ivas->bfi && NE_16( hCPE->hCoreCoder[n]->mct_chan_mode, MCT_CHAN_MODE_IGNORE ) )
#else
            IF( NE_16( hCPE->hCoreCoder[n]->mct_chan_mode, MCT_CHAN_MODE_IGNORE ) )
#endif
            {
                Word16 nSubframes;

+18 −0
Original line number Diff line number Diff line
@@ -382,6 +382,23 @@ void stereo_mdct_core_dec_fx(
        }
    }

#ifdef FIX_2397_COPY_AQ_MDCT_CORE_BFI
    IF( !bfi )
    {
#ifdef FIX_2352_COPY_AQ_IN_TCX
        FOR( ch = 0; ch < nChannels; ch++ )
#else
        FOR( ch = 0; ch < CPE_CHANNELS; ch++ )
#endif
        {
#ifdef FIX_2352_COPY_AQ_IN_TCX
            Copy_Scale_sig_16_32_DEPREC( Aq_fx[ch], Aq_fx_32[ch], i_mult( nSubframes[ch], M ), sub( Q16, Q12 ) ); /* Q16 */
#else
            Copy_Scale_sig_16_32_DEPREC( Aq_fx[ch], Aq_fx_32[ch], ( NB_SUBFR16k + 1 ) * ( M + 1 ), sub( Q16, Q12 ) ); /* Q16 */
#endif
        }
    }
#else
#ifdef FIX_2352_COPY_AQ_IN_TCX
    FOR( ch = 0; ch < nChannels; ch++ )
#else
@@ -394,6 +411,7 @@ void stereo_mdct_core_dec_fx(
        Copy_Scale_sig_16_32_DEPREC( Aq_fx[ch], Aq_fx_32[ch], ( NB_SUBFR16k + 1 ) * ( M + 1 ), sub( Q16, Q12 ) ); /* Q16 */
#endif
    }
#endif

    /*--------------------------------------------------------------------------------*
     * Stereo processing