• Andreas Rheinhardt's avatar
    fftools/ffmpeg_opt: Check attachment filesize · 889ad93c
    Andreas Rheinhardt authored
    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: 's avatarMichael Niedermayer <michael@niedermayer.cc>
    Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
    889ad93c
Name
Last commit
Last update
compat Loading commit data...
doc Loading commit data...
ffbuild Loading commit data...
fftools Loading commit data...
libavcodec Loading commit data...
libavdevice Loading commit data...
libavfilter Loading commit data...
libavformat Loading commit data...
libavresample Loading commit data...
libavutil Loading commit data...
libpostproc Loading commit data...
libswresample Loading commit data...
libswscale Loading commit data...
presets Loading commit data...
tests Loading commit data...
tools Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
.travis.yml Loading commit data...
CONTRIBUTING.md Loading commit data...
COPYING.GPLv2 Loading commit data...
COPYING.GPLv3 Loading commit data...
COPYING.LGPLv2.1 Loading commit data...
COPYING.LGPLv3 Loading commit data...
CREDITS Loading commit data...
Changelog Loading commit data...
INSTALL.md Loading commit data...
LICENSE.md Loading commit data...
MAINTAINERS Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
RELEASE Loading commit data...
configure Loading commit data...