From 8e4d5d9d2fb16e29e4b30a1ae867ab269b1781b3 Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Sun, 2 Sep 2012 22:13:09 +0200 Subject: Use a saturating shift to avoid overflow When the shift overflowed, asserts were triggered later, where the values were assumed to be non-negative. --- libAACenc/src/band_nrg.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libAACenc/src/band_nrg.cpp b/libAACenc/src/band_nrg.cpp index 458aa9c..c672c6c 100644 --- a/libAACenc/src/band_nrg.cpp +++ b/libAACenc/src/band_nrg.cpp @@ -267,7 +267,7 @@ FDKaacEnc_CalcBandEnergyOptimShort(const FIXP_DBL *RESTRICT mdctSpectrum, FIXP_DBL spec = mdctSpectrum[j]<