aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2018-02-23 00:03:15 -0300
committerJames Almer <jamrial@gmail.com>2018-02-24 00:38:00 -0300
commite2edfff9a8f1e0d10af1251f3c90eb806d841c7e (patch)
tree49dca47391600de5011ec9a7ac2e5fe640ddc780
parentfea559c3d5575bce51acdb17cf83a1a8fd237feb (diff)
downloadffmpeg-e2edfff9a8f1e0d10af1251f3c90eb806d841c7e.tar.gz
avformat/hvcc: zero initialize the nal buffers past the last written byte
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)
-rw-r--r--libavformat/hevc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/hevc.c b/libavformat/hevc.c
index 1a2d6cdd2b..25898937a5 100644
--- a/libavformat/hevc.c
+++ b/libavformat/hevc.c
@@ -669,6 +669,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;
}