From 839ae290c1f5a263613bea1a5fde863e757a8849 Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Fri, 10 Aug 2012 00:51:37 +0300 Subject: Use saturating adds to avoid overflow These additions can overflow, triggering assertions later. --- libAACenc/src/grp_data.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libAACenc/src/grp_data.cpp') diff --git a/libAACenc/src/grp_data.cpp b/libAACenc/src/grp_data.cpp index 03d4976..7adcb21 100644 --- a/libAACenc/src/grp_data.cpp +++ b/libAACenc/src/grp_data.cpp @@ -195,7 +195,7 @@ FDKaacEnc_groupShortData(FIXP_DBL *mdctSpectrum, /* in-out FIXP_DBL energy = sfbEnergy->Short[wnd][sfb]; for (j=1; jShort[wnd+j][sfb]; + energy = fAddSaturate(energy, sfbEnergy->Short[wnd+j][sfb]); } sfbEnergy->Long[i++] = energy; } -- cgit v1.2.3