Fix for undefined shift in ducker_apply

These changes handle the Undefined-shift
runtime error reported because value of Q factor
calculated was negative when denominator is zero in division operation.

Bug: ossFuzz:61698
Test: poc in bug
This commit is contained in:
Yash Patil 2023-09-01 16:04:23 +05:30 • committed by Divya B M
parent 91dbf5577d
commit 29d968bd4c

View file

@ -837,6 +837,9 @@ static VOID ixheaacd_ducker_apply(
if (ixheaacd_mps_comp(temp3, temp_1, &qtemp, qtemp1)) {
temp_2 = ixheaacd_mps_div_32(temp3, temp_1, &qtemp2);
qtemp2 = qtemp2 + qtemp - qtemp1;
if (temp_1 == 0) {
qtemp2 = qtemp;
}
temp3 = qtemp2 > 28 ? MAX_32 : 4 << qtemp2;
if (temp_2 > temp3) {