summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarish Mahendrakar <harish.mahendrakar@ittiam.com>2015-08-26 16:17:55 +0530
committerMarco Nelissen <marcone@google.com>2015-10-16 20:12:42 +0000
commit7ba9f34a49f119a4448e874fec45c2bb14f87028 (patch)
tree517cd50bfcef741f6e2118f8c234135e0f9e07df
parente023fbb28cc48187d0608c8bca52098bfd9e9fb9 (diff)
downloadandroid_external_libavc-7ba9f34a49f119a4448e874fec45c2bb14f87028.tar.gz
android_external_libavc-7ba9f34a49f119a4448e874fec45c2bb14f87028.tar.bz2
android_external_libavc-7ba9f34a49f119a4448e874fec45c2bb14f87028.zip
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
-rw-r--r--decoder/ih264d_api.c5
1 files changed, 5 insertions, 0 deletions
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 @@ 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;
}