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:
parent
4d7d9daad6
commit
864279697e
1 changed files with 3 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue