Commit a0e09cef authored by Manuel Jander's avatar Manuel Jander
Browse files

Fix crashes from issue #2232. Look at CLDFB states additionally to the input...

Fix crashes from issue #2232. Look at CLDFB states additionally to the input for dynamic scale. Similar to MR !2555 , issues #2217 and #2219
parent 770db85d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -112,6 +112,8 @@
#define NONBE_FIX_2206_SATURATE_ALTERNATIVE
#define FIX_2226_ISAR_PRE_CRASH_CLDFB_NO_CHANNELS           /* Dolby: Fix crash of ISAR pre-renderer due to an attempt of re-scaling  uninitialized values in the CLDFB filter bank */

#define NONBE_FIX_ISSUE_2232_CHECK_CLDFB_STATES             /* FhG: Adjust scaleFactor according to st->cldfbSyn->cldfb_state_fx too to avoid overflow in cldfbSynthesis_ivas_fx() */

/* ################### End FIXES switches ########################### */

/* #################### Start BASOP porting switches ############################ */
+3 −0
Original line number Diff line number Diff line
@@ -1819,6 +1819,9 @@ static void isar_rend_CldfbSplitPostRendProcessTdIn(
            RealBuffer_fx[slot_idx] = Cldfb_RealBuffer_Binaural_fx[ch_idx][slot_idx];
            ImagBuffer_fx[slot_idx] = Cldfb_ImagBuffer_Binaural_fx[ch_idx][slot_idx];
            scaleFactor = s_min( scaleFactor, s_min( getScaleFactor32( RealBuffer_fx[slot_idx], CLDFB_NO_CHANNELS_MAX ), getScaleFactor32( ImagBuffer_fx[slot_idx], CLDFB_NO_CHANNELS_MAX ) ) );
#ifdef NONBE_FIX_ISSUE_2232_CHECK_CLDFB_STATES
            scaleFactor = s_min( scaleFactor, getScaleFactor32( hBinHrSplitPostRend->cldfbSyn[ch_idx]->cldfb_state_fx, hBinHrSplitPostRend->cldfbSyn[ch_idx]->p_filter_length ) );
#endif
        }
        scaleFactor = s_min( sub( scaleFactor, 6 ), Q24 ); // guarded bits
        FOR( slot_idx = 0; slot_idx < CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES; slot_idx++ )