Go to file
Andreas Rheinhardt 2ee4077248 avfilter/vf_morpho: Fix invalid frees on error
The current code used a pointer to an array (of arrays) that
is offset relative to the start of the actually allocated buffer.
Yet offsetting the pointer is only done on success, whereas the
freeing code believes it to have happened even on error.
So if any of the subarrays (or the subarrays' subarrays) can't
be successfully allocated, one gets a bad free in free_lut().

Furthermore, said offsetting is only permissible in case the
offsetted pointer points in the allocated buffer (here: in case
the LUT's min_r is <= 0), as pointer arithmetic is undefined
in case it exceeds the allocated object.

Moreover, in case one of the subarrays couldn't be allocated,
the code nevertheless tried to free the subarray's subarrays;
and in case one of the subarray's subarrays could not be allocated
successfully, there will be an invalid free, too, because the
pointers for the subarrays' subarrays are also offset compared
to the base pointer.

This commit fixes all of this, by using the actually allocated
pointer for freeing and by adding appropriate checks before
freeing the subarrays. The former also allows to distinguish
the cases in which the lut is currently only half-allocated due to
an error in an earlier allocation attempt from the success case.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-04 17:27:50 +02:00
compat Replace all occurences of av_mallocz_array() by av_calloc() 2021-09-20 01:03:52 +02:00
doc examples/qsvdec: Don't use stack packet 2021-10-03 20:50:50 +02:00
ffbuild avfilter: compress CUDA PTX code if possible 2021-06-22 14:05:44 +02:00
fftools fftools/ffmpeg, doc/examples: Remove redundant av_packet_unref 2021-10-03 20:50:49 +02:00
libavcodec avcodec/amrnbdec: move channel_size bellow to avoid array overreads 2021-10-03 12:13:53 +02:00
libavdevice libavdevice/avfoundation.m: fix potential unreleased lock issue 2021-09-17 15:31:40 +02:00
libavfilter avfilter/vf_morpho: Fix invalid frees on error 2021-10-04 17:27:50 +02:00
libavformat avformat/{isom,mov,movenc}: add support for CMAF DASH roles 2021-10-04 17:55:27 +03:00
libavutil avutil/md5: Avoid av_unused variable 2021-10-02 17:13:57 +02:00
libpostproc libpostproc/postprocess_template: Don't reimplement FFSWAP 2021-10-02 17:13:42 +02:00
libswresample swresample/aarch64: fix relocation out of range error 2021-09-25 21:55:29 +03:00
libswscale swscale/swscale: Pass slice location into unscaled code also for dst scaling 2021-10-03 20:38:29 +02:00
presets
tests avformat/{isom,mov,movenc}: add support for CMAF DASH roles 2021-10-04 17:55:27 +03:00
tools tools/target_dec_fuzzer: Adjust threshold for WMV2 2021-09-26 17:22:22 +02:00
.gitattributes
.gitignore avfilter: compress CUDA PTX code if possible 2021-06-22 14:05:44 +02:00
.mailmap
.travis.yml
Changelog avfilter: add (a)latency filters 2021-10-02 18:49:40 +02:00
configure configure: arm: Don't add -march= to the compiler if no preference was passed 2021-09-21 14:04:28 +03:00
CONTRIBUTING.md
COPYING.GPLv2
COPYING.GPLv3
COPYING.LGPLv2.1
COPYING.LGPLv3 Add configure option to upgrade (L)GPL to version 3. 2009-06-05 11:04:03 +00:00
CREDITS
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 Bump Versions before release/4.4 branch 2021-03-20 01:01:12 +01:00

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.