summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/codecs
diff options
context:
space:
mode:
authorMartin Storsjo <martin@martin.st>2011-05-18 12:29:28 +0300
committerMartin Storsjo <martin@martin.st>2012-07-10 13:37:42 +0300
commit6d72a807dc3910ddd0b7c4f85130951dd189e8f5 (patch)
tree36dc3c057d9986f08ee9d01726aaf4c03ae38cdf /media/libstagefright/codecs
parentffb829430ff20ccd6c13e6ed894f2373b2d93939 (diff)
downloadframeworks_av-6d72a807dc3910ddd0b7c4f85130951dd189e8f5.zip
frameworks_av-6d72a807dc3910ddd0b7c4f85130951dd189e8f5.tar.gz
frameworks_av-6d72a807dc3910ddd0b7c4f85130951dd189e8f5.tar.bz2
amrnb: Restart the p_xn pointer when retraversing the array on overflow
This is a safeguard to avoid issues in a rare codepath. This was committed on the master branch of the opencore repository in commit f532d145194e474cb30d8644b8eee83873ad24cc, based on AOSP contribution 10905. Change-Id: I9688b009bcbe63d88ee5040e883a021aefa30664
Diffstat (limited to 'media/libstagefright/codecs')
-rw-r--r--media/libstagefright/codecs/amrnb/enc/src/g_pitch.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/media/libstagefright/codecs/amrnb/enc/src/g_pitch.cpp b/media/libstagefright/codecs/amrnb/enc/src/g_pitch.cpp
index f6235ad..5b80e2a 100644
--- a/media/libstagefright/codecs/amrnb/enc/src/g_pitch.cpp
+++ b/media/libstagefright/codecs/amrnb/enc/src/g_pitch.cpp
@@ -400,8 +400,9 @@ Word16 G_pitch( /* o : Gain of pitch lag saturated to 1.2 */
}
else
{
- s = 0; /* Avoid case of all zeros */
+ s = 0; /* re-initialize calculations */
p_y1 = &y1[0];
+ p_xn = &xn[0];
for (i = (L_subfr >> 2); i != 0; i--)
{
L_temp = (Word32)(*(p_y1++) >> 2);