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

Commit f8321d62 authored by Martin Storsjo's avatar Martin Storsjo Committed by Jean-Baptiste Queru
Browse files

stagefright aacenc: Fix reading out of bounds in pow2_xy

This fixes cases where x was a large number, causing fPart to
exceed the 32 bit signed integer range (while fitting in an
unsigned 32 bit integer), making the table index a negative
number.

Change-Id: I674047db65f89148a93d218c138b42cd8305f80e
parent f6554832
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -344,8 +344,8 @@ static const Word32 pow2Table[POW2_TABLE_SIZE] = {
*/
Word32 pow2_xy(Word32 x, Word32 y)
{
  Word32 iPart;
  Word32 fPart;
  UWord32 iPart;
  UWord32 fPart;
  Word32 res;
  Word32 tmp, tmp2;
  Word32 shift, shift2;