mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-25 00:32:31 +00:00
avcodec/h264_sei: fix the size of user data unregistered
According to the specifications, the payloadSize includes the 16-byte size of UUID. Signed-off-by: Limin Wang <lance.lmwang@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
parent
a86bb2f606
commit
5e5bbd21e6
@ -247,14 +247,14 @@ static int decode_unregistered_user_data(H264SEIUnregistered *h, GetBitContext *
|
|||||||
uint8_t *user_data;
|
uint8_t *user_data;
|
||||||
int e, build, i;
|
int e, build, i;
|
||||||
|
|
||||||
if (size < 16 || size >= INT_MAX - 16)
|
if (size < 16 || size >= INT_MAX - 1)
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
|
|
||||||
user_data = av_malloc(16 + size + 1);
|
user_data = av_malloc(size + 1);
|
||||||
if (!user_data)
|
if (!user_data)
|
||||||
return AVERROR(ENOMEM);
|
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] = get_bits(gb, 8);
|
||||||
|
|
||||||
user_data[i] = 0;
|
user_data[i] = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user