Decoder: Memset 8 extra bytes at the end of internal bitstream buffer
Decoder may read 8 extra bytes at the end of this buffer, though it will never be used Setting it to zero will ensure unitialized reads are avoided Change-Id: I724239861cb9fa64f3a70cb5450e094cb3afa20c
This commit is contained in:
parent
09c58b2c06
commit
f377e8cb05
1 changed files with 5 additions and 0 deletions
|
|
@ -1955,6 +1955,11 @@ WORD32 ih264d_video_decode(iv_obj_t *dec_hdl, void *pv_api_ip, void *pv_api_op)
|
|||
{
|
||||
memcpy(pu1_bitstrm_buf, pu1_buf + u4_length_of_start_code,
|
||||
buflen);
|
||||
/* Decoder may read extra 8 bytes near end of the frame */
|
||||
if((buflen + 8) < buf_size)
|
||||
{
|
||||
memset(pu1_bitstrm_buf + buflen, 0, 8);
|
||||
}
|
||||
u4_first_start_code_found = 1;
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue