Fix for integer overflow's in ixheaacd_voronoi_search

Saturation checks has been added after 32 bit
additions and multiplication to avoid integer
overflows in this CL.

Bug:120252825
Test: poc
Change-Id: Ifec303f477de51c218f8cfeb8a4a8ac3e570fcd5
This commit is contained in:
Rajat Kumar 2018-12-13 12:32:08 +05:30 • committed by Ray Essick
parent 4d7d9daad6
commit 864279697e

View file

@ -161,7 +161,9 @@ VOID ixheaacd_voronoi_idx_dec(WORD32 *kv, WORD32 m, WORD32 *y, WORD32 count) {
z[i] = y[i] >> count;
rem1[i] = y[i] & (m - 1);
}
y[0] += (4 * kv[0] + sum);
y[0] = ixheaacd_add32_sat(
y[0],
ixheaacd_add32_sat(ixheaacd_sat64_32((WORD64)4 * (WORD64)kv[0]), sum));
z[0] = (y[0] - 2) >> count;
if (m != 0)
rem1[0] = (y[0] - 2) % m;