summaryrefslogtreecommitdiffstats
path: root/libAACenc/src/aacenc_tns.cpp
diff options
context:
space:
mode:
authorMartin Storsjo <martin@martin.st>2012-08-10 00:51:37 +0300
committerMartin Storsjo <martin@martin.st>2012-08-10 11:01:36 +0300
commit839ae290c1f5a263613bea1a5fde863e757a8849 (patch)
tree868a5773eec2ec0c3df04dc7141e058d1280a0e1 /libAACenc/src/aacenc_tns.cpp
parentd8e8f1ac46cd55ded2dd42adf89e95092bcc04ea (diff)
downloadfdk-aac-dabplus-839ae290c1f5a263613bea1a5fde863e757a8849.tar.gz
fdk-aac-dabplus-839ae290c1f5a263613bea1a5fde863e757a8849.tar.bz2
fdk-aac-dabplus-839ae290c1f5a263613bea1a5fde863e757a8849.zip
Use saturating adds to avoid overflow
These additions can overflow, triggering assertions later.
Diffstat (limited to 'libAACenc/src/aacenc_tns.cpp')
-rw-r--r--libAACenc/src/aacenc_tns.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libAACenc/src/aacenc_tns.cpp b/libAACenc/src/aacenc_tns.cpp
index 933e4e7..fbff424 100644
--- a/libAACenc/src/aacenc_tns.cpp
+++ b/libAACenc/src/aacenc_tns.cpp
@@ -1150,8 +1150,8 @@ static INT FDKaacEnc_AutoToParcor(
for(j=numOfCoeff-i-1; j>=0; j--) {
FIXP_DBL accu1 = fMult(tmp, input[j]);
FIXP_DBL accu2 = fMult(tmp, workBuffer[j]);
- workBuffer[j] += accu1;
- input[j] += accu2;
+ workBuffer[j] = fAddSaturate(workBuffer[j], accu1);
+ input[j] = fAddSaturate(input[j], accu2);
}
workBuffer++;