Skip to content
Commit 27bd8da9 authored by Martin Storsjo's avatar Martin Storsjo
Browse files

stagefright aacenc: Avoid overflows when calculating normFactor

normFactor is calculated using the saturating L_add function,
but if the value added (*psfbPeFactors) is negative, the sum
can end up negative.

*psfbPeFactors can end up negative if redThrExp is less than
*psfbNActiveLines.

In cases where *psfbPeFactors ended up negative, normFactor
became INT_MIN, causing division by zero later.

Change-Id: I00c852e457b22f7eef4d6ed1887629828057206b
parent 23d36286
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment