[FFmpeg-devel] [PATCH 2/2] avformat/swfdec: Check outlen before allocation
Anton Khirnov
anton at khirnov.net
Sat Jan 23 16:29:38 EET 2021
Quoting Michael Niedermayer (2021-01-22 15:09:47)
> Fixes: Timeout (too long -> 241ms)
> Fixes: 29083/clusterfuzz-testcase-minimized-ffmpeg_dem_SWF_fuzzer-6273684478230528
>
> Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> ---
> libavformat/swfdec.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/libavformat/swfdec.c b/libavformat/swfdec.c
> index 1463f0ad4d..aa4be88f91 100644
> --- a/libavformat/swfdec.c
> +++ b/libavformat/swfdec.c
> @@ -367,6 +367,9 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt)
> ff_dlog(s, "bitmap: ch=%d fmt=%d %dx%d (linesize=%d) len=%d->%ld pal=%d\n",
> ch_id, bmp_fmt, width, height, linesize, len, out_len, colormapsize);
>
> + if (len * 17373LL < out_len)
Where does the magic number come from?
--
Anton Khirnov
More information about the ffmpeg-devel
mailing list