Commit 6256d892 authored by Jan Kiene's avatar Jan Kiene
Browse files

Merge branch '135-use-of-uninitialized-value-in-sba-mdct-stereo-core' into 'main'

Resolve "Use-of-Uninitialized value in SBA MDCT-Stereo core"

See merge request !154
parents b2080fe8 790a5483
Loading
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -158,6 +158,8 @@

#define ALIGN_SID_SIZE                                  /* Issue 111: make all DTX modes use one SID frame bitrate (5.2 kbps) */

#define FIX_135_MDCT_STEREO_MODE_UNINITIALIZED          /* Issue 135: fix uninitialized value usage in SBA MDCT-Stereo core with PLC */

/* ################## End DEVELOPMENT switches ######################### */
/* clang-format on */
#endif
+6 −0
Original line number Diff line number Diff line
@@ -823,6 +823,12 @@ ivas_error create_cpe_dec(
        set_s( hCPE->hStereoMdct->prev_ms_mask[0], 0, MAX_SFB );
        set_s( hCPE->hStereoMdct->prev_ms_mask[1], 0, MAX_SFB );
        hCPE->hStereoMdct->lastCoh = 1.f;
#ifdef FIX_135_MDCT_STEREO_MODE_UNINITIALIZED
        hCPE->hStereoMdct->mdct_stereo_mode[0] = SMDCT_DUAL_MONO;
        hCPE->hStereoMdct->mdct_stereo_mode[1] = SMDCT_DUAL_MONO;
        hCPE->hStereoMdct->IGFStereoMode[0] = -1;
        hCPE->hStereoMdct->IGFStereoMode[1] = -1;
#endif
    }

    /*-----------------------------------------------------------------*
+2 −0
Original line number Diff line number Diff line
@@ -218,11 +218,13 @@ void stereo_mdct_core_dec(
    initMdctStereoDecData( hCPE->hStereoMdct, sts[0]->igf, sts[0]->hIGFDec->igfData.igfInfo.grid, hCPE->element_brate, sts[0]->bwidth );

    hCPE->hStereoMdct->isSBAStereoMode = ( ( st_ivas->ivas_format == SBA_FORMAT ) && ( st_ivas->nchan_transport == 2 ) );
#ifndef FIX_135_MDCT_STEREO_MODE_UNINITIALIZED
    /*to prevent unitialized values during condition checks for stereo IGF*/
    if ( hCPE->hStereoMdct->isSBAStereoMode )
    {
        set_s( hCPE->hStereoMdct->IGFStereoMode, -1, 2 );
    }
#endif

    if ( !bfi )
    {