From bbb46304786e4cb8b68ca2bcbdf66a649d135b97 Mon Sep 17 00:00:00 2001 From: Yash Patil Date: Mon, 11 Sep 2023 18:49:02 +0530 Subject: [PATCH] Fix for Undefined-shift in ixheaacd_windowing_short2 These changes handle the Undefined-shift runtime error reported because the value of shift was coming greater than 31. Bug: ossFuzz:61678 Test: poc in bug --- decoder/ixheaacd_imdct.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/decoder/ixheaacd_imdct.c b/decoder/ixheaacd_imdct.c index c8d17de..fb868db 100644 --- a/decoder/ixheaacd_imdct.c +++ b/decoder/ixheaacd_imdct.c @@ -392,6 +392,9 @@ static IA_ERRORCODE ixheaacd_fd_imdct_short(ia_usac_data_struct *usac_data, ixheaacd_normalize(p_in_ibuffer, max_shift - 1, ixheaacd_drc_offset->n_long); shiftp += max_shift - 1; + if ((shiftp - shift_olap) > 31) { + shiftp = 31 + shift_olap; + } err_code = ixheaacd_calc_window(&window_short, ixheaacd_drc_offset->n_short, window_select, usac_data->ec_flag); if (err_code == -1) return err_code;