From e7bf3124d9d77f0b1308dcc63a56b34923217332 Mon Sep 17 00:00:00 2001 From: Eleni Fotopoulou Date: Mon, 7 Oct 2024 10:27:47 +0200 Subject: [PATCH] fix for crash reported in issue 879 --- lib_com/options.h | 3 +++ lib_dec/tonalMDCTconcealment_fx.c | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index bc5e5f09e..34db79ed7 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -183,6 +183,9 @@ #define FIX_871_REMOVE_UNNECESSARY_CONDITION /* VA: remove a condition that is not needed and prevented correct frame classification of the secondary channel of the TD stereo */ #define FIX_875_SATURATION_DURING_ROUNDING /* VA: fix a possible saturation when rounding */ + +#define FIX_879_DIFF_CONCEAL_PATH /* FhG: Fix for issue 879 and different concelalment paths that led to crash */ + /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_dec/tonalMDCTconcealment_fx.c b/lib_dec/tonalMDCTconcealment_fx.c index 69905d141..93e2f24cc 100644 --- a/lib_dec/tonalMDCTconcealment_fx.c +++ b/lib_dec/tonalMDCTconcealment_fx.c @@ -2022,7 +2022,11 @@ ELSE FOR( i = 1; i < hTonalMDCTConc->pTCI->numIndexes; i++ ) { tmp = round_fx( BASOP_Util_fPow( L_deposit_h( tiltFactor ), 0, L_deposit_h( (UWord16) L_add( L_sub( hTonalMDCTConc->pTCI->upperIndex[i - 1], hTonalMDCTConc->pTCI->lowerIndex[i - 1] ), 1 ) ), 15, &exp ) ); +#ifdef FIX_879_DIFF_CONCEAL_PATH + tmp = shl_sat( tmp, exp ); +#else tmp = shl( tmp, exp ); +#endif tilt = mult_r( tilt, tmp ); // Q15 FOR( l = hTonalMDCTConc->pTCI->lowerIndex[i]; l <= hTonalMDCTConc->pTCI->upperIndex[i]; l++ ) -- GitLab