Commit c7ea1c01 authored by multrus's avatar multrus
Browse files

Merge branch '2090_basop_portFlp2275_CrashTnsEnc' into 'main'

Port Flp MR 2275 to main - Resolve "Crash possible in Encoding of TNS Data for MDCT-Stereo core"

Closes #2090

See merge request !2357
parents f82745bd f57bcd2b
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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 ############################ */

+13 −0
Original line number Diff line number Diff line
@@ -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
                                }
                            }
                        }