Commit db5de5ef authored by fotopoulou's avatar fotopoulou
Browse files

fix crash reported in BASOP issue 1585

parent 6a06b484
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -208,6 +208,7 @@


#define FIX_1430_EVS_STEREO_DMX_CHANNEL_DISAPPEARING    /* Orange: Fix for basop issue 2184 - to prevent one channel from becoming inaudible in the mono downmix output */
#define FIX_1430_EVS_STEREO_DMX_CHANNEL_DISAPPEARING    /* Orange: Fix for basop issue 2184 - to prevent one channel from becoming inaudible in the mono downmix output */
#define FIX_1440_AMR_WB_RESET                           /* VA: issue 1440: Fix missing AMR-WB IO memory reset (applicable to float only) */
#define FIX_1440_AMR_WB_RESET                           /* VA: issue 1440: Fix missing AMR-WB IO memory reset (applicable to float only) */
#define FIX_BASOP_ISSUE_1585_CUT_BS_CRASH               /* FhG: Fix for BASOP issue 1585 crash of a cut bitstream, also valid for float code*/


/* ##################### End NON-BE switches ########################### */
/* ##################### End NON-BE switches ########################### */


+1 −1
Original line number Original line Diff line number Diff line
@@ -663,7 +663,7 @@ ivas_error core_switching_post_dec(
            }
            }
            else if ( ( ( st->last_core == ACELP_CORE || st->last_core_bfi == ACELP_CORE ) && !( st->prev_bfi == 1 && st->last_con_tcx == 1 ) ) || st->last_core == AMR_WB_CORE ) /*ACELP->TCX/HQ*/
            else if ( ( ( st->last_core == ACELP_CORE || st->last_core_bfi == ACELP_CORE ) && !( st->prev_bfi == 1 && st->last_con_tcx == 1 ) ) || st->last_core == AMR_WB_CORE ) /*ACELP->TCX/HQ*/
            {
            {
                /* if this is first active MDCT-Stereo frame after a CNG frame and output format is mono DMX, this should only be done for the zero-th channel, the other one will simply be copied over after this function */
                /* if output format is mono DMX, this should only be done for the zero-th channel, the other one will simply be copied over after this function */
                if ( ( ( st->last_core_brate != SID_2k40 && st->last_core_brate != FRAME_NO_DATA ) || ( st->element_mode != IVAS_CPE_DFT && st->element_mode != IVAS_CPE_TD ) || nchan_out == 1 ) && !( st->element_mode == IVAS_CPE_MDCT && st->idchan == 1 && ( nchan_out == 1 || last_element_mode == IVAS_CPE_DFT ) ) )
                if ( ( ( st->last_core_brate != SID_2k40 && st->last_core_brate != FRAME_NO_DATA ) || ( st->element_mode != IVAS_CPE_DFT && st->element_mode != IVAS_CPE_TD ) || nchan_out == 1 ) && !( st->element_mode == IVAS_CPE_MDCT && st->idchan == 1 && ( nchan_out == 1 || last_element_mode == IVAS_CPE_DFT ) ) )
                {
                {
                    core_switch_lb_upsamp( st, output );
                    core_switch_lb_upsamp( st, output );
+4 −0
Original line number Original line Diff line number Diff line
@@ -160,6 +160,10 @@ static void dec_prm_tcx_sidebits(
        st->last_core_from_bs = st->last_core;
        st->last_core_from_bs = st->last_core;
    }
    }


#ifdef FIX_BASOP_ISSUE_1585_CUT_BS_CRASH
    /* for first frame reset last_core to initialization value for better error-robustness*/
    st->last_core = -1;
#endif
    getTCXWindowing( st->core, st->last_core, st->element_mode, st->hTcxCfg, st0 );
    getTCXWindowing( st->core, st->last_core, st->element_mode, st->hTcxCfg, st0 );


    st->hTcxDec->kernel_type[0] = st->hTcxDec->kernel_type[1] = MDCT_IV;
    st->hTcxDec->kernel_type[0] = st->hTcxDec->kernel_type[1] = MDCT_IV;