avformat/hvcc: zero initialize the nal buffers past the last written byte
authorJames Almer <jamrial@gmail.com>
Fri, 23 Feb 2018 03:03:15 +0000 (00:03 -0300)
committerJames Almer <jamrial@gmail.com>
Sat, 24 Feb 2018 03:36:57 +0000 (00:36 -0300)
Prevents use of uninitialized values.

Fixes ticket #7038.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 9482ec1b203e4cf51d7f60c85d261cc13f9a9d2f)

libavformat/hevc.c

index 7c294ef..4c7ffc3 100644 (file)
@@ -668,6 +668,8 @@ static uint8_t *nal_unit_extract_rbsp(const uint8_t *src, uint32_t src_len,
     while (i < src_len)
         dst[len++] = src[i++];
 
+    memset(dst + len, 0, AV_INPUT_BUFFER_PADDING_SIZE);
+
     *dst_len = len;
     return dst;
 }