From f57bcd2b10c95011e7cfbe2ab863cac74b13d0c2 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Thu, 9 Oct 2025 21:07:32 +0200 Subject: [PATCH] port flp MR 2275 to main --- lib_com/options.h | 1 + lib_enc/cod_tcx_fx.c | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 10140324e..c941842df 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -150,6 +150,7 @@ #define FIX_1385_INIT_IGF_STOP_FREQ /* FhG: Initialize infoIGFStopFreq in init_igf_dec() */ #define FIX_1387_INIT_PRM_SQQ /* FhG: initialize pointer prm_sqQ, which might be uninitialized in case of bfi == 1 */ #define NONBE_1296_TDREND_ITD_OUT_OF_BOUNDS_ACCESS /* Eri: issue 1296: ITD resampling can occasionally read out of bounds, especially when the requested subframes are short (1.25 ms). Seen for headtracking+JBM. */ +#define FIX_1349_TNS_CRASH /* FhG: Fix crash in TNS entropy coding, in case order of joint TNS coding is reduced to 0 */ /* #################### End BASOP porting switches ############################ */ diff --git a/lib_enc/cod_tcx_fx.c b/lib_enc/cod_tcx_fx.c index 4a1222aa9..a08a81c4a 100644 --- a/lib_enc/cod_tcx_fx.c +++ b/lib_enc/cod_tcx_fx.c @@ -5128,6 +5128,19 @@ void TNSAnalysisStereo_fx( move16(); move16(); } +#ifdef FIX_1349_TNS_CRASH + ELSE + { + pFilter[0]->filterType = TNS_FILTER_OFF; + pFilter[1]->filterType = TNS_FILTER_OFF; + sts[0]->hTcxEnc->tnsData[k].nFilters = 0; + sts[1]->hTcxEnc->tnsData[k].nFilters = 0; + move16(); + move16(); + move16(); + move16(); + } +#endif } } } -- GitLab