Re: [FFmpeg-devel] [PATCH v3 4/5] avcodec/h264_sei: fix the size of user data unregistered

2019-12-20 Thread James Almer
On 12/19/2019 2:09 AM, lance.lmw...@gmail.com wrote:
> From: Limin Wang 
> 
> According to the specifications, the payloadSize includes the 16-byte size of 
> UUID.
> 
> Signed-off-by: Limin Wang 
> ---
>  libavcodec/h264_sei.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/libavcodec/h264_sei.c b/libavcodec/h264_sei.c
> index d4eb9c0dab..a565feabe2 100644
> --- a/libavcodec/h264_sei.c
> +++ b/libavcodec/h264_sei.c
> @@ -247,14 +247,14 @@ static int 
> decode_unregistered_user_data(H264SEIUnregistered *h, GetBitContext *
>  uint8_t *user_data;
>  int e, build, i;
>  
> -if (size < 16 || size >= INT_MAX - 16)
> +if (size < 16 || size >= INT_MAX - 1)
>  return AVERROR_INVALIDDATA;
>  
> -user_data = av_malloc(16 + size + 1);
> +user_data = av_malloc(size + 1);
>  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;

Applied, thanks.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH v3 4/5] avcodec/h264_sei: fix the size of user data unregistered

2019-12-18 Thread lance . lmwang
From: Limin Wang 

According to the specifications, the payloadSize includes the 16-byte size of 
UUID.

Signed-off-by: Limin Wang 
---
 libavcodec/h264_sei.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/h264_sei.c b/libavcodec/h264_sei.c
index d4eb9c0dab..a565feabe2 100644
--- a/libavcodec/h264_sei.c
+++ b/libavcodec/h264_sei.c
@@ -247,14 +247,14 @@ static int 
decode_unregistered_user_data(H264SEIUnregistered *h, GetBitContext *
 uint8_t *user_data;
 int e, build, i;
 
-if (size < 16 || size >= INT_MAX - 16)
+if (size < 16 || size >= INT_MAX - 1)
 return AVERROR_INVALIDDATA;
 
-user_data = av_malloc(16 + size + 1);
+user_data = av_malloc(size + 1);
 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;
-- 
2.21.0

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".