aboutsummaryrefslogtreecommitdiffstats
path: root/libSBRenc
diff options
context:
space:
mode:
authorMartin Storsjo <martin@martin.st>2017-03-14 14:29:20 +0200
committerMartin Storsjo <martin@martin.st>2017-03-14 14:37:55 +0200
commit5eb6f0db8cc1ecc00af2ef534078e4c65fdf978f (patch)
treea4329cf93ad4e7b6a9d36d5947c4b9f668e8dc5e /libSBRenc
parent32c712cbd10975888a6e0bd117387a2c65e5a23c (diff)
downloadfdk-aac-5eb6f0db8cc1ecc00af2ef534078e4c65fdf978f.tar.gz
fdk-aac-5eb6f0db8cc1ecc00af2ef534078e4c65fdf978f.tar.bz2
fdk-aac-5eb6f0db8cc1ecc00af2ef534078e4c65fdf978f.zip
Saturate additions in spectralChange
This fixes a crash.
Diffstat (limited to 'libSBRenc')
-rw-r--r--libSBRenc/src/tran_det.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libSBRenc/src/tran_det.cpp b/libSBRenc/src/tran_det.cpp
index 33ea60e..0e35ec3 100644
--- a/libSBRenc/src/tran_det.cpp
+++ b/libSBRenc/src/tran_det.cpp
@@ -187,12 +187,12 @@ static FIXP_DBL spectralChange(FIXP_DBL Energies[NUMBER_TIME_SLOTS_2304][MAX_FRE
/* Sum up energies in first half */
for (i=start; i<border; i++) {
- accu1 += scaleValue(Energies[i][j], -energies_e_diff[i]);
+ accu1 = fAddSaturate(accu1, scaleValue(Energies[i][j], -energies_e_diff[i]));
}
/* Sum up energies in second half */
for (i=border; i<stop; i++) {
- accu2 += scaleValue(Energies[i][j], -energies_e_diff[i]);
+ accu2 = fAddSaturate(accu2, scaleValue(Energies[i][j], -energies_e_diff[i]));
}
/* Energy change in current band */