mirror of
https://github.com/ittiam-systems/libhevc.git
synced 2026-08-14 23:02:35 +07:00
Merge "Fix OOB issue in nal unit parsing" into lmp-dev am: 1ce65aea9f am: c1451ed95b am: 18a325cf80 am: f9a3d7de57
am: 835420e636
Change-Id: Ib3d17c44f069b1043cc3e4a9eb646f887d1605b9
This commit is contained in:
commit
364a6b9d1d
1 changed files with 4 additions and 3 deletions
|
|
@ -114,7 +114,8 @@ WORD32 ihevcd_nal_search_start_code(UWORD8 *pu1_buf, WORD32 bytes_remaining)
|
|||
}
|
||||
|
||||
zero_byte_cnt++;
|
||||
if((pu1_buf[ofst + 1] == START_CODE_PREFIX_BYTE) &&
|
||||
if((ofst < (bytes_remaining - 1)) &&
|
||||
(pu1_buf[ofst + 1] == START_CODE_PREFIX_BYTE) &&
|
||||
(zero_byte_cnt >= NUM_ZEROS_BEFORE_START_CODE))
|
||||
{
|
||||
/* Found the start code */
|
||||
|
|
@ -123,7 +124,7 @@ WORD32 ihevcd_nal_search_start_code(UWORD8 *pu1_buf, WORD32 bytes_remaining)
|
|||
break;
|
||||
}
|
||||
}
|
||||
if(0 == start_code_found)
|
||||
if((0 == start_code_found) && (ofst < bytes_remaining))
|
||||
{
|
||||
if((START_CODE_PREFIX_BYTE == pu1_buf[ofst]) &&
|
||||
(zero_byte_cnt >= NUM_ZEROS_BEFORE_START_CODE))
|
||||
|
|
@ -231,7 +232,7 @@ IHEVCD_ERROR_T ihevcd_nal_remv_emuln_bytes(UWORD8 *pu1_src,
|
|||
|
||||
}
|
||||
|
||||
if(0 == start_code_found)
|
||||
if((0 == start_code_found) && (src_cnt < bytes_remaining))
|
||||
{
|
||||
u1_src = pu1_src[src_cnt++];
|
||||
if(zero_byte_cnt >= NUM_ZEROS_BEFORE_START_CODE)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue