Commit 0aa89070 authored by multrus's avatar multrus
Browse files

Merge branch...

Merge branch 'basop-2355-clang18-msan-use-of-uninitialized-value-in-lib_enc-igf_enc_fx-c-4298-9' into 'main'

Resolve "[CLANG18] MSAN: use-of-uninitialized-value in lib_enc/igf_enc_fx.c:4298:9"

Closes #2355

See merge request !2753
parents ed872af4 0d04343c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -118,6 +118,7 @@
#define FIX_2352_COPY_AQ_IN_TCX                         /* FhG: basop issue 2352: prevent copying uninitialized values from Aq_fx[][] to Aq_fx_32[][] in TCX */
#define FIX_2353_PTR_INIT                               /* FhG: basop issue 2353: initialize prm_sqQ-pointer, to prevent being uninitialized in case of bfi == 1 */
#define FIX_2356_GET_CHAN_ENERGIES                      /* FhG: basop issue 2356: correctly initialize exponents in getChannelEnergies_fx() */
#define FIX_2355_IGF_EXP_POWERSPEC                      /* FhG: basop issue 2355: make sure exp_pPowerSpectrumParameter_fx is initialized in all cases */

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

+12 −1
Original line number Diff line number Diff line
@@ -3320,9 +3320,13 @@ static void IGF_Whitening_ivas_fx(
                    FOR( sb = hGrid->tile[p]; sb < hGrid->tile[p + 1]; sb++ )
                    {
                        IF( LT_32( powerSpectrum[sb], 1 ) )
                        {
                            hPrivateData->logSpec[sb] = 0; /* max(0,FLT_MIN_EXP=-125 )*/
                        }
                        ELSE
                        {
                            hPrivateData->logSpec[sb] = extract_l( L_max( 0, L_shr( L_add( BASOP_Util_Log2( powerSpectrum[sb] ), L_shl( powerSpectrum_e[sb], Q25 ) ), Q25 ) ) );
                        }
                        move16();
                    }
                }
@@ -4271,6 +4275,10 @@ void IGFEncApplyStereo_fx(
    {
        pPowerSpectrumParameter_fx[0] = NULL;
        pPowerSpectrumParameter_fx[1] = NULL;
#ifdef FIX_2355_IGF_EXP_POWERSPEC
        exp_pPowerSpectrumParameter_fx[0] = NULL;
        exp_pPowerSpectrumParameter_fx[1] = NULL;
#endif
        pPowerSpectrumParameterMsInv_fx[0] = NULL;
        pPowerSpectrumParameterMsInv_fx[1] = NULL;
        q_pPowerSpectrumParameterMsInv_fx[0] = NULL;
@@ -4293,6 +4301,9 @@ void IGFEncApplyStereo_fx(
        ELSE
        {
            pPowerSpectrumParameter_fx[ch] = NULL;
#ifdef FIX_2355_IGF_EXP_POWERSPEC
            exp_pPowerSpectrumParameter_fx[ch] = NULL;
#endif
        }

        IGF_Whitening_ivas_fx( hIGFEnc[ch], pPowerSpectrumParameter_fx[ch], exp_pPowerSpectrumParameter_fx[ch], igfGridIdx, sts[ch]->hTranDet->transientDetector.bIsAttackPresent, last_core_acelp, ( sts[0]->hTcxEnc->fUseTns[frameno] || sts[1]->hTcxEnc->fUseTns[frameno] ), sp_aud_decision0, element_brate, sts[ch]->element_mode );