Fix for undefined shift in ixheaacd_gen_rand_vec

These changes handle the Undefined-shift runtime error
reported because the value of scale exponent was coming
less than -31.

Bug: ossFuzz:61684
Test: poc in bug
This commit is contained in:
Yash Patil 2023-09-11 18:49:39 +05:30
parent bbb4630478
commit 632e575ee6

View file

@ -101,6 +101,9 @@ VOID ixheaacd_gen_rand_vec(WORD32 scale, WORD shift, WORD32 *ptr_spec_coef,
spec = ptr_spec_coef;
if (shift < -31) {
shift = -31;
}
for (sfb = 0; sfb <= sfb_width; sfb++) {
*spec = ixheaac_shr32_dir_sat_limit(ixheaac_mult32_shl_sat(*spec, scale),
shift);