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
diff --git a/decoder/ih264d_api.c b/decoder/ih264d_api.c
index ddbf769..fc21a06 100644
--- a/decoder/ih264d_api.c
+++ b/decoder/ih264d_api.c
@@ -1955,6 +1955,11 @@
{
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;
}