Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6d72a807 authored by Martin Storsjo's avatar Martin Storsjo
Browse files

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
parent ffb82943
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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);