Commit 3b878d71 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh Committed by Fabian Bauer
Browse files

Fix for 3GPP issue 1132: crash stereo_tca_enc_fx() for stereo encoder

Link #1132
parent 247295ac
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -104,4 +104,5 @@
#define FIX_1100_REMOVE_LPC_RESCALING           /* VA: Remove the rescaling of LPC coefficient to Q12 as residu and syn-filt are already taking care of it*/

#define FIX_ISSUE_1122                          /* Ittiam: Fix issue 1122: corrected incorrect scaling of a buffer leading to incorrect metadata bits */
#define FIX_1132_STACK_CORRUPTION               /* Stack corruption issue due of extending index access*/
#endif
+9 −0
Original line number Diff line number Diff line
@@ -241,7 +241,16 @@ ivas_error stereo_memory_enc_fx(
    test();
    IF( hCPE->hStereoTCA != NULL && EQ_16( hCPE->last_element_mode, IVAS_CPE_DFT ) )
    {
#ifdef FIX_1132_STACK_CORRUPTION
        Word16 tmp = extract_h( abs( hCPE->hStereoDft->hItd->itd_fx[1] ) );
        if ( hCPE->hStereoDft->hItd->itd_fx[1] < 0 )
        {
            tmp = negate( tmp );
        }
        set16_fx( hCPE->hStereoTCA->prevCorrLagStats, tmp, 3 );
#else
        set16_fx( hCPE->hStereoTCA->prevCorrLagStats, extract_h( hCPE->hStereoDft->hItd->itd_fx[1] ), 3 );
#endif
        IF( hCPE->hStereoDft->hItd->itd_fx[1] >= 0 )
        {
            hCPE->hStereoTCA->prevRefChanIndx = L_CH_INDX;