diff --git a/lib_com/options.h b/lib_com/options.h index 6eeb9dd94f9883c5e26863ea453ed625f71c0128..7cfe422154dc859de78f1404f205588bc4ef4c74 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -204,6 +204,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.c b/lib_enc/cod_tcx.c index 89282ed8b47aeaef18e90e2af78df893a5eb9bb7..9a890ae3c9f4deb10580190b4f37b9ebbc844971 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 } } }