ffmpeg/fftools
Andreas Rheinhardt 259edd9293 fftools/ffmpeg_opt: Check attachment filesize
The data of an attachment file is put into an AVCodecParameter's
extradata. The corresponding size field has type int, yet there was no
check for the size to fit into an int. As a consequence, it was possible
to create extradata with negative size (by using a big enough max_alloc).

Other errors were also possible: If SIZE_MAX < INT64_MAX (e.g. on 32bit
systems) then the file size might be truncated before the allocation;
and avio_read() takes an int, too, so one would not have read as much
as one desired.

Furthermore, the extradata is now padded as is required.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
(cherry picked from commit 889ad93c88)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-07-02 00:03:01 +02:00
..
Makefile
cmdutils.c cmdutils: print a more descriptive error message in show_help_bsf() when no bsf is specified 2018-07-28 11:14:45 -03:00
cmdutils.h
ffmpeg.c fftools/ffmpeg: Free swresample dictionary during cleanup 2020-07-01 22:33:24 +02:00
ffmpeg.h
ffmpeg_cuvid.c
ffmpeg_filter.c fftools/ffmpeg_filter: Replace the number by macro for bprint init 2018-06-17 09:59:33 +08:00
ffmpeg_hw.c
ffmpeg_opt.c fftools/ffmpeg_opt: Check attachment filesize 2020-07-02 00:03:01 +02:00
ffmpeg_qsv.c fftools/qsv: add extra_hw_frames support 2018-08-07 11:26:40 +08:00
ffmpeg_videotoolbox.c
ffplay.c ffplay: add options to specify window position 2018-10-07 20:44:22 +02:00
ffprobe.c