aboutsummaryrefslogtreecommitdiffstats
path: root/libAACenc/src/aacenc_tns.cpp
diff options
context:
space:
mode:
authorMartin Storsjo <martin@martin.st>2017-10-30 23:06:44 +0200
committerMartin Storsjo <martin@martin.st>2017-10-30 23:06:44 +0200
commit1e3515e03e2dbdbd48dacc31ef75d25c201a4c51 (patch)
treee688d513590f1bc1db74ed624620e14b47e679a2 /libAACenc/src/aacenc_tns.cpp
parentcf697df5ad1495f167181dec0976ee228bec6378 (diff)
downloadfdk-aac-1e3515e03e2dbdbd48dacc31ef75d25c201a4c51.tar.gz
fdk-aac-1e3515e03e2dbdbd48dacc31ef75d25c201a4c51.tar.bz2
fdk-aac-1e3515e03e2dbdbd48dacc31ef75d25c201a4c51.zip
Fix an assertion failure (avoid division by zero) when encoding a particular input
Diffstat (limited to 'libAACenc/src/aacenc_tns.cpp')
-rw-r--r--libAACenc/src/aacenc_tns.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/libAACenc/src/aacenc_tns.cpp b/libAACenc/src/aacenc_tns.cpp
index 5fcd309..3026d69 100644
--- a/libAACenc/src/aacenc_tns.cpp
+++ b/libAACenc/src/aacenc_tns.cpp
@@ -1147,6 +1147,9 @@ static INT FDKaacEnc_AutoToParcor(
workBuffer++;
}
+ if (input[0] == 0)
+ input[0] = 1;
+
tmp = fMult((FIXP_DBL)((LONG)TNS_PREDGAIN_SCALE<<21), fDivNorm(fAbs(autoCorr_0), fAbs(input[0]), &scale));
if ( fMultDiv2(autoCorr_0, input[0])<FL2FXCONST_DBL(0.0f) ) {
tmp = -tmp;