FFmpeg git repo
Go to file
Andreas Rheinhardt 80d32e0f7e avfilter/af_agate: Honour query_formats API, fix segfault
The sidechaingate filter wants its main input and its (only) output
to have the same channel layout and number of channels; yet it does
not link them in its query_formats callback. Instead it sets the
outlink to only accept the first offered choice for the main input's
channel layout and then sets both inputs to independently accept
any channel counts. The config_output callback then overwrote the
outlink's channel layout and channels properties with the main input's,
even though they may differ in case the first offered choice for
the main input's channel layout turns out not to be the final one.

Consider e.g. the following filtergraph:
[in]aformat=channel_layouts=mono,aformat=channel_layouts=stereo|mono[out];\
[out][in2]sidechaingate,stereotools
The two aformats ensure that the first offered channel layout (stereo)
will not be chosen for the input; yet it is the only offered channel
layout for the output of sidechaingate and will therefore be chosen
by the query_formats framework. Because the sidechaingate outputs
interleaved doubles which stereotools expects the output of
sidechaingate appears to be suitable as input for stereotools without
further conversions. Yet stereotools actually only receives a mono frame
and therefore overreads its input buffer which leads to segfaults;
it can also lead to heap corruption because there can be writes beyond
the end of the buffer, too.

Fix this by linking the channel layouts of the main input and the output
in query_formats and remove the code overwriting it in config_output.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-21 17:56:11 +02:00
compat Replace all occurences of av_mallocz_array() by av_calloc() 2021-09-20 01:03:52 +02:00
doc doc/demuxers: fix typo in concatdec options 2021-09-21 00:19:19 -05:00
ffbuild avfilter: compress CUDA PTX code if possible 2021-06-22 14:05:44 +02:00
fftools ffmpeg_filter: don't try to autorotate frames with hwaccel pixel formats 2021-09-21 10:41:16 -03:00
libavcodec avcodec/libdav1d: pass auto threads value to libdav1d 2021-09-20 22:30:35 -03:00
libavdevice libavdevice/avfoundation.m: fix potential unreleased lock issue 2021-09-17 15:31:40 +02:00
libavfilter avfilter/af_agate: Honour query_formats API, fix segfault 2021-09-21 17:56:11 +02:00
libavformat Replace all occurences of av_mallocz_array() by av_calloc() 2021-09-20 01:03:52 +02:00
libavutil avutil/mem: Deprecate av_mallocz_array() 2021-09-20 01:04:09 +02:00
libpostproc postproc/postprocess: Remove legacy cruft 2021-07-29 22:02:06 +02:00
libswresample Replace all occurences of av_mallocz_array() by av_calloc() 2021-09-20 01:03:52 +02:00
libswscale Replace all occurences of av_mallocz_array() by av_calloc() 2021-09-20 01:03:52 +02:00
presets
tests Replace all occurences of av_mallocz_array() by av_calloc() 2021-09-20 01:03:52 +02:00
tools Replace all occurences of av_mallocz_array() by av_calloc() 2021-09-20 01:03:52 +02:00
.gitattributes
.gitignore avfilter: compress CUDA PTX code if possible 2021-06-22 14:05:44 +02:00
.mailmap
.travis.yml
CONTRIBUTING.md
COPYING.GPLv2
COPYING.GPLv3
COPYING.LGPLv2.1
COPYING.LGPLv3
CREDITS
Changelog avfilter: add audio psychoacoustic clipper 2021-09-11 16:19:40 +02:00
INSTALL.md
LICENSE.md
MAINTAINERS avformat: add Argonaut Games CVG demuxer 2021-05-12 20:25:50 +10:00
Makefile FATE: add a test for sliced scaling 2021-08-08 19:26:05 +02:00
README.md
RELEASE
configure configure: arm: Don't add -march= to the compiler if no preference was passed 2021-09-21 14:04:28 +03:00

README.md

FFmpeg README

FFmpeg is a collection of libraries and tools to process multimedia content such as audio, video, subtitles and related metadata.

Libraries

  • libavcodec provides implementation of a wider range of codecs.
  • libavformat implements streaming protocols, container formats and basic I/O access.
  • libavutil includes hashers, decompressors and miscellaneous utility functions.
  • libavfilter provides a mean to alter decoded Audio and Video through chain of filters.
  • libavdevice provides an abstraction to access capture and playback devices.
  • libswresample implements audio mixing and resampling routines.
  • libswscale implements color conversion and scaling routines.

Tools

  • ffmpeg is a command line toolbox to manipulate, convert and stream multimedia content.
  • ffplay is a minimalistic multimedia player.
  • ffprobe is a simple analysis tool to inspect multimedia content.
  • Additional small tools such as aviocat, ismindex and qt-faststart.

Documentation

The offline documentation is available in the doc/ directory.

The online documentation is available in the main website and in the wiki.

Examples

Coding examples are available in the doc/examples directory.

License

FFmpeg codebase is mainly LGPL-licensed with optional components licensed under GPL. Please refer to the LICENSE file for detailed information.

Contributing

Patches should be submitted to the ffmpeg-devel mailing list using git format-patch or git send-email. Github pull requests should be avoided because they are not part of our review process and will be ignored.