diff options
author | Yash Patil <yash.patil@ittiam.com> | 2023-09-11 18:49:39 +0530 |
---|---|---|
committer | Yash Patil <yash.patil@ittiam.com> | 2023-09-11 18:49:39 +0530 |
commit | 632e575ee645919c2eba81a7de114cfca66a4087 (patch) | |
tree | 0b700170081162b873d3b2b29873b2ca54a5ded5 | |
parent | bbb46304786e4cb8b68ca2bcbdf66a649d135b97 (diff) | |
download | libxaac-632e575ee645919c2eba81a7de114cfca66a4087.tar.gz |
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
-rw-r--r-- | decoder/ixheaacd_pns_js_thumb.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/decoder/ixheaacd_pns_js_thumb.c b/decoder/ixheaacd_pns_js_thumb.c index e6ba987..c39b3f2 100644 --- a/decoder/ixheaacd_pns_js_thumb.c +++ b/decoder/ixheaacd_pns_js_thumb.c @@ -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); |