Fix for Out of bound access issue reported by fuzzer

This commit is contained in:
Nikhil Bhavikatti 2022-07-29 17:00:56 +05:30
parent c9614b8df9
commit a857637600

View file

@ -17,6 +17,7 @@
*****************************************************************************
* Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore
*/
#include <stdlib.h>
#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));