Commit 61180a98 authored by multrus's avatar multrus
Browse files

basop issue 2382: 2nd instance of prevent copying uninitialized values from...

basop issue 2382: 2nd instance of prevent copying uninitialized values from Aq_fx[][] to Aq_fx_32[][] in TCX
parent c0947d4a
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -102,6 +102,7 @@
#define FIX_2319_CLDFB_INIT_FLAGS                       /* FhG: basop issue 2319: init hs->flags during openCldfb(), to avoid reading of uninitialized memory */
#define FIX_BASOP_2357_OBJECT_EDIT_MSAN                 /* Nokia: basop issue 2357: initialize missing exponents in object edit */
#define FIX_BASOP_2354_MSAN_DIFF_Q_VALUE                /* Nokia: Initialize Q value of diffuseness in rendering to Q30 */
#define FIX_2382_COPY_AQ_IN_MCT                         /* FhG: basop issue 2382: 2nd instance of prevent copying uninitialized values from Aq_fx[][] to Aq_fx_32[][] in TCX */

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

+23 −2
Original line number Diff line number Diff line
@@ -214,22 +214,43 @@ ivas_error ivas_mct_dec_fx(
        }
    }

#ifndef FIX_2382_COPY_AQ_IN_MCT
    Word32 Aq_fx_32[6][2][102];
#endif
    /* MCT reconstruction and CoreCoder updates */
    FOR( cpe_id = 0; cpe_id < nCPE; cpe_id++ )
    {
#ifdef FIX_2382_COPY_AQ_IN_MCT
        Word32 Aq_fx_32[CPE_CHANNELS][( NB_SUBFR16k + 1 ) * ( M + 1 )];
#endif
        hCPE = st_ivas->hCPE[cpe_id];

        FOR( n = 0; n < CPE_CHANNELS; n++ )
        {
#ifdef FIX_2382_COPY_AQ_IN_MCT
            IF( NE_16( hCPE->hCoreCoder[n]->mct_chan_mode, MCT_CHAN_MODE_IGNORE ) )
            {
                Word16 nSubframes;

                nSubframes = EQ_16( hCPE->hCoreCoder[n]->core, TCX_10_CORE ) ? NB_DIV : 1; /* Q0 */
                move16();

                Copy_Scale_sig_16_32_DEPREC( Aq_fx[cpe_id][n], Aq_fx_32[n], i_mult( nSubframes, M ), Q16 - Q12 ); // Q16
            }
#else
            Copy_Scale_sig_16_32_DEPREC( Aq_fx[cpe_id][n], Aq_fx_32[cpe_id][n], 102, Q16 - Q12 ); // Q16
#endif
            x_fx[n][0] = output_fx[n + ( cpe_id * CPE_CHANNELS )];                      // Q11
            x_fx[n][1] = output_fx[n + ( cpe_id * CPE_CHANNELS )] + ( L_FRAME48k / 2 ); // Q11
            move16();
            move16();
        }

#ifdef FIX_2382_COPY_AQ_IN_MCT
        ivas_mdct_core_tns_ns_fx( hCPE, fUseTns[cpe_id], tnsData[cpe_id], x_fx, Aq_fx_32, 1, 20 );
#else
        ivas_mdct_core_tns_ns_fx( hCPE, fUseTns[cpe_id], tnsData[cpe_id], x_fx, Aq_fx_32[cpe_id], 1, 20 );
#endif
    }

    test();