summaryrefslogtreecommitdiffstats
path: root/media/libstagefright
diff options
context:
space:
mode:
authorConley Owens <cco3@android.com>2012-03-09 15:15:32 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2012-03-09 15:15:32 -0800
commit8f3ca6347650aa17ca06452e5ae1a76921bd2f22 (patch)
tree932807f7c3d64ad937ece314897cdf5853399af6 /media/libstagefright
parent3162225d51c62cd6f0e89edc5fe272adbc8ddc39 (diff)
parent3557654c95bae7754dcd1951ec10742b895817e2 (diff)
downloadframeworks_base-8f3ca6347650aa17ca06452e5ae1a76921bd2f22.zip
frameworks_base-8f3ca6347650aa17ca06452e5ae1a76921bd2f22.tar.gz
frameworks_base-8f3ca6347650aa17ca06452e5ae1a76921bd2f22.tar.bz2
am 3557654c: am 66da3fdc: am 972efafb: am 6db6ea02: Merge changes I00c852e4,Ib31bf028
* commit '3557654c95bae7754dcd1951ec10742b895817e2': stagefright aacenc: Avoid overflows when calculating normFactor stagefright aacenc: Avoid a division by zero
Diffstat (limited to 'media/libstagefright')
-rw-r--r--media/libstagefright/codecs/aacenc/src/adj_thr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/media/libstagefright/codecs/aacenc/src/adj_thr.c b/media/libstagefright/codecs/aacenc/src/adj_thr.c
index 373b063..07b33b7 100644
--- a/media/libstagefright/codecs/aacenc/src/adj_thr.c
+++ b/media/libstagefright/codecs/aacenc/src/adj_thr.c
@@ -438,7 +438,7 @@ static void correctThresh(PSY_OUT_CHANNEL psyOutChannel[MAX_CHANNELS],
for (sfb=0; sfb<psyOutChan->maxSfbPerGroup; sfb++) {
Word32 redThrExp = thrExp[ch][sfbGrp+sfb] + redVal;
- if (((*pahFlag < AH_ACTIVE) || (deltaPe > 0)) && (redThrExp > 0) ) {
+ if (((*pahFlag < AH_ACTIVE) || (deltaPe > 0)) && (redThrExp > 0) && (redThrExp >= *psfbNActiveLines)) {
*psfbPeFactors = (*psfbNActiveLines) * (0x7fffffff / redThrExp);
normFactor = L_add(normFactor, *psfbPeFactors);
@@ -466,7 +466,7 @@ static void correctThresh(PSY_OUT_CHANNEL psyOutChannel[MAX_CHANNELS],
deltaSfbPe = *psfbPeFactors * deltaPe;
/* thr3(n) = thr2(n)*2^deltaSfbPe/b(n) */
- if (*psfbNActiveLines > 0) {
+ if (*psfbNActiveLines > 0 && (normFactor* (*psfbNActiveLines)) != 0) {
/* new threshold */
Word32 thrFactor;
sfbEn = psyOutChan->sfbEnergy[sfbGrp+sfb];