Commit 1482c15c authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Fix for crash issue 689

[x] Added fix for write access violation happening in
save_synthesis_hq_fec_fx().
[x]  Fixes crash in stereo_dft_dec function.
parent 396398b5
Loading
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -607,11 +607,10 @@ ivas_error init_decoder(
        set_f( st->hTcxDec->FBTCXdelayBuf_float, 0.0f, 111 );

        st->hTcxDec->old_synthFB = st->hTcxDec->synth_history + NS2SA( st->output_Fs, PH_ECU_MEM_NS );
#ifdef IVAS_FLOAT_FIXED
        st->hTcxDec->old_synthFB_fx = st->hTcxDec->synth_history_fx + NS2SA( st->output_Fs, PH_ECU_MEM_NS );
#endif
        st->hTcxDec->prev_good_synth = st->hTcxDec->old_synthFB + NS2SA( st->output_Fs, PH_ECU_LOOKAHEAD_NS );
#ifdef IVAS_FLOAT_FIXED
        set32_fx(st->hTcxDec->FBTCXdelayBuf, 0, 111);
        st->hTcxDec->old_synthFB_fx = st->hTcxDec->synth_history_fx + NS2SA( st->output_Fs, PH_ECU_MEM_NS );
        st->hTcxDec->prev_good_synth_fx = st->hTcxDec->old_synthFB_fx + NS2SA(st->output_Fs, PH_ECU_LOOKAHEAD_NS);
#endif
    }
+2 −1
Original line number Diff line number Diff line
@@ -527,7 +527,7 @@ ivas_error ivas_cpe_dec_fx(
                    }
                }
                i_max_val_psd =  (int)max_val;
                sts[0]->hFdCngDec->q_smoothed_psd = norm_l(i_max_val_psd) - Q9;
                sts[0]->hFdCngDec->q_smoothed_psd = norm_l(i_max_val_psd) - Q4;
                max_val = 0.0;
                for (int ii = 0; ii < sizeof(DFT) / sizeof(DFT[0]); ii++)
                {
@@ -545,6 +545,7 @@ ivas_error ivas_cpe_dec_fx(
                {
                    hCPE->hStereoDft->q_dft = Q15;
                }
                hCPE->hStereoDft->q_dft = s_min(hCPE->hStereoDft->q_dft, sts[0]->hFdCngDec->q_smoothed_psd);
                IF (EQ_16(hCPE->hStereoDft->first_frame, 1))
                {
                    hCPE->hStereoDft->q_smoothed_nrg = hCPE->hStereoDft->q_dft;
+5 −1
Original line number Diff line number Diff line
@@ -768,7 +768,11 @@ ivas_error stereo_memory_dec(
            set_f( st->hTcxDec->FBTCXdelayBuf_float, 0.0f, 111 );
            st->hTcxDec->old_synthFB = st->hTcxDec->synth_history + NS2SA( st->output_Fs, PH_ECU_MEM_NS );
            st->hTcxDec->prev_good_synth = st->hTcxDec->old_synthFB + NS2SA( st->output_Fs, PH_ECU_LOOKAHEAD_NS );

#ifdef IVAS_FLOAT_FIXED
            set32_fx(st->hTcxDec->FBTCXdelayBuf, 0, 111);
            st->hTcxDec->old_synthFB_fx = st->hTcxDec->synth_history_fx + NS2SA(st->output_Fs, PH_ECU_MEM_NS);
            st->hTcxDec->prev_good_synth_fx = st->hTcxDec->old_synthFB_fx + NS2SA(st->output_Fs, PH_ECU_LOOKAHEAD_NS);
#endif
            /* allocate and initialize MDCT stereo structure */
            if ( ( hCPE->hStereoMdct = (STEREO_MDCT_DEC_DATA_HANDLE) malloc( sizeof( STEREO_MDCT_DEC_DATA ) ) ) == NULL )
            {