[FFmpeg-devel] [PATCH v2] libavformat/asfdec: Fix regression bug when reading image attachments

Soft Works softworkz at hotmail.com
Sun Aug 8 02:56:23 EEST 2021



> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces at ffmpeg.org> On Behalf Of
> Soft Works
> Sent: Sunday, 8 August 2021 01:53
> To: ffmpeg-devel at ffmpeg.org
> Subject: [FFmpeg-devel] [PATCH v2] libavformat/asfdec: Fix regression bug
> when reading image attachments
> 
> Commit c8140fe7324f264faacf7395b27e12531d1f13f7 had introduced a check
> for value_len > UINT16_MAX.
> As a consequence, attached images of sizes larger than UINT16_MAX could
> no longer be read.
> 
> Signed-off-by: softworkz <softworkz at hotmail.com>
> ---
> v2: Fix without changing variable type
>  libavformat/asfdec_f.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavformat/asfdec_f.c b/libavformat/asfdec_f.c index
> ff6ddfb967..b9f3918495 100644
> --- a/libavformat/asfdec_f.c
> +++ b/libavformat/asfdec_f.c
> @@ -614,7 +614,7 @@ static int asf_read_metadata(AVFormatContext *s,
> int64_t size)
>          value_type = avio_rl16(pb); /* value_type */
>          value_len  = avio_rl32(pb);
> 
> -        if (value_len < 0 || value_len > UINT16_MAX)
> +        if (value_len < 0)
>              return AVERROR_INVALIDDATA;
> 
>          name_len_utf8 = 2*name_len_utf16 + 1;
> --
> 2.28.0.windows.1

@Carl - I'm flexible, though. Better now?

softworkz


More information about the ffmpeg-devel mailing list