FFmpeg git repo
Go to file
Timo Rothenpieler 7945d30e91 avutil/mem: limit alignment to maximum simd align
FFmpeg has instances of DECLARE_ALIGNED(32, ...) in a lot of structs,
which then end up heap-allocated.
By declaring any variable in a struct, or tree of structs, to be 32 byte
aligned, it allows the compiler to safely assume the entire struct
itself is also 32 byte aligned.

This might make the compiler emit code which straight up crashes or
misbehaves in other ways, and at least in one instances is now
documented to actually do (see ticket 10549 on trac).
The issue there is that an unrelated variable in SingleChannelElement is
declared to have an alignment of 32 bytes. So if the compiler does a copy
in decode_cpe() with avx instructions, but ffmpeg is built with
--disable-avx, this results in a crash, since the memory is only 16 byte
aligned.

Mind you, even if the compiler does not emit avx instructions, the code
is still invalid and could misbehave. It just happens not to. Declaring
any variable in a struct with a 32 byte alignment promises 32 byte
alignment of the whole struct to the compiler.

This patch limits the maximum alignment to the maximum possible simd
alignment according to configure.
While not perfect, it at the very least gets rid of a lot of UB, by
matching up the maximum DECLARE_ALIGNED value with the alignment of heap
allocations done by lavu.
2024-02-27 19:41:09 +01:00
compat configure: Set WIN32_LEAN_AND_MEAN at configure time 2023-08-14 22:57:28 +03:00
doc avformat/mov: add support for tile HEIF still images 2024-02-26 12:21:12 -03:00
ffbuild riscv: test for assembler support 2023-12-08 17:21:09 +02:00
fftools fftools/ffmpeg_mux: Fix use of uninitialized variable 2024-02-25 13:41:56 +01:00
libavcodec lavc/dnxhdenc: add ff_dnxhdenc_init 2024-02-27 20:32:37 +02:00
libavdevice all: use designated initializers for AVOption.unit 2024-02-14 14:53:41 +01:00
libavfilter avfilter/tonemap_vaapi: Remove duplicate format check 2024-02-26 14:52:06 +08:00
libavformat avformat/mov: Don't use entry[-1] in pointer arithmetic 2024-02-27 10:27:42 +01:00
libavutil avutil/mem: limit alignment to maximum simd align 2024-02-27 19:41:09 +01:00
libpostproc Bump versions after 6.1 2023-10-29 16:19:14 +01:00
libswresample all: use designated initializers for AVOption.unit 2024-02-14 14:53:41 +01:00
libswscale libswscale/utils: Fix bayer to yuvj 2024-02-21 18:24:17 +01:00
presets
tests fate/mov: add tests for HEIF samples with derived images 2024-02-26 12:21:12 -03:00
tools tools: Add target_sws_fuzzer.c 2024-02-21 18:24:17 +01:00
.gitattributes lavf/assenc: normalize line endings to \n 2024-02-11 17:01:07 -08:00
.gitignore gitignore: add config_components.h 2022-03-17 18:35:41 -03:00
.mailmap .mailmap: Update my mailmap entry 2024-02-23 00:17:21 +01:00
.travis.yml Merge commit '899ee03088d55152a48830df0899887f055da1de' 2019-03-14 15:53:16 -03:00
CONTRIBUTING.md
COPYING.GPLv2
COPYING.GPLv3
COPYING.LGPLv2.1
COPYING.LGPLv3
CREDITS Use https for repository links 2023-03-01 21:59:10 +01:00
Changelog Require compilers to support C11. 2024-02-18 07:38:28 +01:00
INSTALL.md INSTALL.md: Fix Markdown formatting 2019-01-31 10:29:16 -09:00
LICENSE.md avfilter/vf_geq: Relicense to LGPL 2019-12-28 11:20:48 +01:00
MAINTAINERS MAINTAINERS: remove myself from here 2024-02-04 22:22:42 +01:00
Makefile tools: Add target_sws_fuzzer.c 2024-02-21 18:24:17 +01:00
README.md README: fix typo and description of libavfilter 2021-10-08 09:44:34 +05:30
RELEASE RELEASE: update after 5.1 branch 2022-07-13 00:31:42 +02:00
configure configure: Disable linker warnings for common symbols 2024-02-26 22:09:19 +01: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 means to alter decoded audio and video through a directed graph of connected 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.