[FFmpeg-devel] [PATCH v1 4/5] avcodec/h264_sei: fix the size of user data unregistered
lance.lmwang at gmail.com
lance.lmwang at gmail.com
Tue Dec 17 12:22:16 EET 2019
From: Limin Wang <lance.lmwang at gmail.com>
According to the specifications, the payloadSize includes the 16-byte size of UUID.
Signed-off-by: Limin Wang <lance.lmwang at gmail.com>
---
libavcodec/h264_sei.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/libavcodec/h264_sei.c b/libavcodec/h264_sei.c
index d4eb9c0dab..46fe8692dd 100644
--- a/libavcodec/h264_sei.c
+++ b/libavcodec/h264_sei.c
@@ -250,14 +250,15 @@ static int decode_unregistered_user_data(H264SEIUnregistered *h, GetBitContext *
if (size < 16 || size >= INT_MAX - 16)
return AVERROR_INVALIDDATA;
- user_data = av_malloc(16 + size + 1);
+ user_data = av_malloc(size + AV_INPUT_BUFFER_PADDING_SIZE);
if (!user_data)
return AVERROR(ENOMEM);
- for (i = 0; i < size + 16; i++)
+ for (i = 0; i < size; i++)
user_data[i] = get_bits(gb, 8);
- user_data[i] = 0;
+ memset(user_data + size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
+
e = sscanf(user_data + 16, "x264 - core %d", &build);
if (e == 1 && build > 0)
h->x264_build = build;
--
2.21.0
More information about the ffmpeg-devel
mailing list