Commit b11d93b8 authored by multrus's avatar multrus
Browse files

Merge branch...

Merge branch 'basop-2509-evs-mono-readinig-of-uninitialized-memory-in-calcpowerspecanddetecttonalcomponents_fx' into 'main'

Resolve "EVS Mono: Reading of uninitialized memory in CalcPowerSpecAndDetectTonalComponents_fx()"

Closes #2509

See merge request !2924
parents 2a9e19a1 22200701
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -104,6 +104,7 @@
#define FIX_2489_HARMONIZE_FdCng_encodeSID              /* FhG: harmonize FdCng_encodeSID_fx() and FdCng_encodeSID_ivas_fx()  */
#define FIX_1527_CMR_BITRATE_IDX                        /* Fix for incorrect bitrate idx packed in rtp CMR E-byte */
#define HARMONIZE_2494_FdCng_decodeSID_fx               /* FhG: harmonize FdCng_decodeSID_fx with _ivas_ version */
#define FIX_BASOP_2509_EVS_CONCEAL_UNINIT_MEM           /* FhG: BASOP 2509: st->hTcxCfg->psychParamsCurrent is not initialized */

/* #################### End BE switches ################################## */

+6 −1
Original line number Diff line number Diff line
@@ -7295,7 +7295,12 @@ ivas_error ppp_quarter_decoder_fx(
void open_decoder_LPD_fx(
    Decoder_State *st,
    const Word32 total_brate, /* Q0 */
#ifndef FIX_BASOP_2509_EVS_CONCEAL_UNINIT_MEM
    const Word16 bwidth /* Q0 */
#else
    const Word16 bwidth, /* Q0 */
    const Word16 is_init /* i  : indicate call during initialization    */
#endif
);

void open_decoder_LPD_ivas_fx(
+30 −1
Original line number Diff line number Diff line
@@ -20,7 +20,12 @@
void open_decoder_LPD_fx(
    Decoder_State *st,
    const Word32 total_brate, /* Q0 */
#ifndef FIX_BASOP_2509_EVS_CONCEAL_UNINIT_MEM
    const Word16 bwidth /* Q0 */
#else
    const Word16 bwidth, /* Q0 */
    const Word16 is_init /* i  : indicate call during initialization    */
#endif
)
{
    Word16 i;
@@ -206,6 +211,29 @@ void open_decoder_LPD_fx(
        set16_fx( hBWE_TD->cur_sub_Aq_fx, 0, M + 1 ); /* Q12 */
    }

#ifdef FIX_BASOP_2509_EVS_CONCEAL_UNINIT_MEM
    IF( st->hIGFDec != NULL )
    {
        test();
        IF( !is_init || NE_16( st->element_mode, IVAS_CPE_MDCT ) )
        {
            init_tcx_cfg_fx( st->hTcxCfg, total_brate, st->sr_core, st->output_Fs, st->L_frame, st->bwidth, st->hTcxDec->L_frameTCX, st->fscale, st->preemph_fac, st->tcxonly, st->rf_flag, st->igf, st->hIGFDec->infoIGFStopFreq, st->element_mode, st->ini_frame, MCT_flag, fscaleFB );
        }
        ELSE
        {
            st->hTcxCfg->tcx_curr_overlap_mode = st->hTcxCfg->tcx_last_overlap_mode = ALDO_WINDOW;
            move16();
            move16();
            st->hTcxCfg->last_aldo = 1;
            move16();
        }
    }

    IF( st->hTECDec != NULL )
    {
        resetTecDec_Fx( st->hTECDec );
    }
#else
    /*TCX config*/
    st->hTcxCfg->preemph_fac = st->preemph_fac;
    move16();
@@ -269,6 +297,7 @@ void open_decoder_LPD_fx(

    /* Initialize decoder delay */

#endif

    if ( NE_16( st->element_mode, IVAS_SCE ) )
    {
+4 −0
Original line number Diff line number Diff line
@@ -89,7 +89,11 @@ void mode_switch_decoder_LPD_fx(
    test();
    IF( NE_16( fscale, st->fscale ) || ( switchWB != 0 ) || ( bSwitchFromAmrwbIO != 0 ) || EQ_16( st->last_codec_mode, MODE1 ) || st->force_lpd_reset )
    {
#ifdef FIX_BASOP_2509_EVS_CONCEAL_UNINIT_MEM
        open_decoder_LPD_fx( st, total_brate, bwidth, 0 );
#else
        open_decoder_LPD_fx( st, total_brate, bwidth );
#endif
    }
    ELSE
    {
+4 −0
Original line number Diff line number Diff line
@@ -881,7 +881,11 @@ ivas_error init_decoder_fx(
    /* Init Decoder */
    IF( st_fx->element_mode == EVS_MONO )
    {
#ifdef FIX_BASOP_2509_EVS_CONCEAL_UNINIT_MEM
        open_decoder_LPD_fx( st_fx, st_fx->total_brate, st_fx->bwidth, 1 );
#else
        open_decoder_LPD_fx( st_fx, st_fx->total_brate, st_fx->bwidth );
#endif
    }
    ELSE
    {