From a8576376000367a034fdd6770a949116769b4e5b Mon Sep 17 00:00:00 2001 From: Nikhil Bhavikatti <100822@ittiam.com> Date: Fri, 29 Jul 2022 17:00:56 +0530 Subject: [PATCH] Fix for Out of bound access issue reported by fuzzer --- decoder/ixheaacd_block.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/decoder/ixheaacd_block.c b/decoder/ixheaacd_block.c index 0f4afb6..2424676 100644 --- a/decoder/ixheaacd_block.c +++ b/decoder/ixheaacd_block.c @@ -17,6 +17,7 @@ ***************************************************************************** * Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore */ +#include #include "ixheaacd_sbr_common.h" #include "ixheaacd_type_def.h" @@ -1122,6 +1123,10 @@ WORD ixheaacd_huffman_dec_word2(ia_bit_buf_struct *it_bit_buff, WORD32 cb_no, } else { it_bit_buff->ptr_read_next += (it_bit_buff->bit_pos) >> 3; it_bit_buff->bit_pos = it_bit_buff->bit_pos & 0x7; + if ((SIZE_T)(it_bit_buff->ptr_read_next) > (SIZE_T)(it_bit_buff->ptr_bit_buf_end + 1)) + { + return IA_ENHAACPLUS_DEC_EXE_NONFATAL_INSUFFICIENT_INPUT_BYTES; + } bits_cons = ((it_bit_buff->ptr_read_next - start_read_pos) << 3) + ((it_bit_buff->bit_pos - start_bit_pos));