From 38f52b41c0e7a1190cdbef74ec4a4009ea0187e9 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Sun, 5 Oct 2025 20:38:44 +0200 Subject: [PATCH 1/2] fix for TNS crash --- lib_com/options.h | 1 + lib_enc/cod_tcx.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index e69dd22ab8..47ad9f8459 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -173,6 +173,7 @@ #define FIX_1383_HEAD_TRACK_SANITIZER /* Nok: issue 1383: Fix head tracking struc values reading in renderer */ #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 FIX_1349_TNS_CRASH /* FhG: Fix crash in TNS entropy coding, in case order of joint TNS coding is reduced to 0 */ /* #################### End BE switches ################################## */ diff --git a/lib_enc/cod_tcx.c b/lib_enc/cod_tcx.c index 89282ed8b4..fb2e7d9098 100644 --- a/lib_enc/cod_tcx.c +++ b/lib_enc/cod_tcx.c @@ -332,6 +332,15 @@ void TNSAnalysisStereo( pFilter[0]->order = pFilter[1]->order = maxOrder; } +#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; + } +#endif } } } -- GitLab From d46964a3bae8384ed556613a687825dd72382680 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Sun, 5 Oct 2025 20:58:13 +0200 Subject: [PATCH 2/2] formatting --- lib_enc/cod_tcx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_enc/cod_tcx.c b/lib_enc/cod_tcx.c index fb2e7d9098..9a890ae3c9 100644 --- a/lib_enc/cod_tcx.c +++ b/lib_enc/cod_tcx.c @@ -332,7 +332,7 @@ void TNSAnalysisStereo( pFilter[0]->order = pFilter[1]->order = maxOrder; } -#ifdef FIX_1349_TNS_CRASH +#ifdef FIX_1349_TNS_CRASH else { pFilter[0]->filterType = TNS_FILTER_OFF; -- GitLab