librempeg/libavutil
Timo Rothenpieler 6651a36bd3 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.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-03-01 19:21:12 +01:00
..
aarch64 libavutil/aarch64/cpu.c: HWCAPS requires inline asm support. 2023-11-02 21:03:43 +01:00
arm
avr32
loongarch avutil/la: Add function performance testing 2023-05-25 21:05:21 +02:00
mips mips: fix build fail on MIPS R6 2023-03-26 01:46:39 +01:00
ppc libavutil/ppc/cpu.c: check that AT_HWCAP2 is defined 2023-10-19 20:46:55 +02:00
riscv lavu/fixed_dsp: R-V V fmul_window_scaled 2023-11-23 18:57:18 +02:00
sh4
tests avutil/tests/pixelutils: Remove dead code 2024-02-24 15:27:49 +01:00
x86 x86: Remove inline MMX assembly that clobbers the FPU state 2024-02-11 12:27:23 +01:00
.gitignore
adler32.c
adler32.h
aes_ctr.c
aes_ctr.h avutil/aes_ctr: document some missing arguments 2022-10-17 09:56:47 +02:00
aes_internal.h
aes.c avutil/aes: Don't use out-of-bounds index 2022-10-24 16:28:14 +02:00
aes.h avutil/aes: document some missing arguments 2022-10-17 09:56:47 +02:00
ambient_viewing_environment.c avutil: introduce AVAmbientViewingEnvironment side data 2023-01-13 21:26:13 +02:00
ambient_viewing_environment.h avutil: introduce AVAmbientViewingEnvironment side data 2023-01-13 21:26:13 +02:00
attributes_internal.h avutil/attributes_internal: Add visibility pragma 2022-10-10 13:43:59 +02:00
attributes.h
audio_fifo.c avutil/audio_fifo: Constify some pointees 2023-09-12 09:20:13 +02:00
audio_fifo.h avutil/audio_fifo: Constify some pointees 2023-09-12 09:20:13 +02:00
avassert.h lavu/avassert: include config.h 2023-07-12 15:35:37 +02:00
avsscanf.c
avstring.c avutil/avstring: Remove obsolete version.h inclusion 2023-09-07 00:48:50 +02:00
avstring.h avutil/avstring: Remove obsolete version.h inclusion 2023-09-07 00:48:50 +02:00
avutil.h remove GPL-only libpostproc library 2023-12-07 09:41:01 +01:00
avutilres.rc
base64.c
base64.h
blowfish.c
blowfish.h
bprint.c avutil/bprint: Allow size == 0 in av_bprint_init_for_buffer() 2023-08-10 08:53:38 +02:00
bprint.h avutil/bprint: Allow size == 0 in av_bprint_init_for_buffer() 2023-08-10 08:53:38 +02:00
bswap.h lavu/riscv: byte-swap operations 2022-09-13 16:50:43 -03:00
buffer_internal.h
buffer.c
buffer.h
camellia.c
camellia.h avutil/camellia: Fix doxy @param typo 2022-10-17 09:55:19 +02:00
cast5.c avutil/cast5: Avoid undefined shift of uint32_t by 32 places 2022-11-11 12:24:23 +01:00
cast5.h
channel_layout.c avutil/channel_layout: print known layout names in custom layout 2024-02-24 15:27:43 +01:00
channel_layout.h avutil/channel_layout: add FF_CHANNEL_ORDER_NB 2024-02-24 15:27:42 +01:00
colorspace.h
common.h avutil/common: Move includes to the beginning of the file 2024-02-24 15:27:49 +01:00
cpu_internal.h lavu/cpu: detect RISC-V base extensions 2022-09-27 13:19:52 +02:00
cpu.c all: Don't set AVClass.item_name to its default value 2023-12-22 16:49:25 +01:00
cpu.h lavu: add/use flag for RISC-V Zba extension 2023-07-19 19:29:35 +03:00
crc.c
crc.h avutil/crc: Add doxy for missing arguments 2022-10-17 09:56:47 +02:00
csp.c avutil/{color_utils, csp}: merge color_utils into csp and expose API 2023-02-09 15:35:14 +01:00
csp.h avutil/{color_utils, csp}: merge color_utils into csp and expose API 2023-02-09 15:35:14 +01:00
cuda_check.h
des.c
des.h avutil/des: Add doxy for missing arguments 2022-10-17 09:56:47 +02:00
detection_bbox.c
detection_bbox.h avutil/detection_bbox: Add doxy for missing argument 2022-10-17 09:56:47 +02:00
dict_internal.h
dict.c avutil/mem: Don't include avutil.h 2023-09-07 00:42:10 +02:00
dict.h avutil/dict: Improve documentation 2022-11-06 08:26:50 +01:00
display.c
display.h avutil/display: Add file to doxy group 2022-10-17 09:55:19 +02:00
dovi_meta.c
dovi_meta.h
downmix_info.c
downmix_info.h
dynarray.h
emms.h avutil/internal: Don't auto-include emms.h 2023-09-04 11:04:45 +02:00
encryption_info.c avutil/mem: Don't include avutil.h 2023-09-07 00:42:10 +02:00
encryption_info.h
error.c
error.h
eval.c avutil/eval: Use even better PRNG 2024-02-07 23:44:20 +01:00
eval.h apply spelling fixes 2023-11-18 19:55:42 +01:00
executor.c avutil: add thread executor 2023-09-02 02:49:06 +02:00
executor.h avutil: add thread executor 2023-09-02 02:49:06 +02:00
ffmath.h
fifo.c avutil/fifo: Constify AVFifo pointees in peek functions 2023-09-12 09:20:49 +02:00
fifo.h avutil/fifo: Constify AVFifo pointees in peek functions 2023-09-12 09:20:49 +02:00
file_open.c all: Don't set AVClass.item_name to its default value 2023-12-22 16:49:25 +01:00
file_open.h
file.c all: Don't set AVClass.item_name to its default value 2023-12-22 16:49:25 +01:00
file.h avutil/file: Add doxy for missing arguments 2022-10-17 09:56:47 +02:00
film_grain_params.c
film_grain_params.h
fixed_dsp.c lavu/fixed_dsp: add missing av_restrict qualifiers 2022-10-04 10:56:12 +02:00
fixed_dsp.h lavu/fixeddsp: RISC-V V butterflies_fixed 2022-09-27 13:19:52 +02:00
float2half.c
float2half.h
float_dsp.c lavu/floatdsp: RISC-V V vector_fmul_scalar 2022-09-27 13:19:52 +02:00
float_dsp.h lavu/floatdsp: RISC-V V vector_fmul_scalar 2022-09-27 13:19:52 +02:00
frame.c avutil/imgutils: Add wrapper for av_image_copy() to avoid casts 2023-09-12 09:42:27 +02:00
frame.h lavu: add video_hint API 2023-08-08 09:46:11 +02:00
getenv_utf8.h
half2float.c
half2float.h
hash.c avutil/mem: Don't include avutil.h 2023-09-07 00:42:10 +02:00
hash.h
hdr_dynamic_metadata.c avutil/hdr_dynamic_metadata: allow av_dynamic_hdr_plus_to_t35() to accept an existing buffer 2023-04-05 09:47:12 -03:00
hdr_dynamic_metadata.h avutil/hdr_dynamic_metadata: allow av_dynamic_hdr_plus_to_t35() to accept an existing buffer 2023-04-05 09:47:12 -03:00
hdr_dynamic_vivid_metadata.c
hdr_dynamic_vivid_metadata.h libavutil/hdr_dynamic_vivid_metadata: fix three spline params 2023-03-17 18:51:16 +08:00
hmac.c avutil/mem: Don't include avutil.h 2023-09-07 00:42:10 +02:00
hmac.h
hwcontext_cuda_internal.h
hwcontext_cuda.c libavutil/hwcontext_cuda: don't destroy external context when using current CUDA context 2023-09-29 19:42:11 +02:00
hwcontext_cuda.h avutil/hwcontext_cuda: add option to use current device context 2023-09-28 19:23:51 +02:00
hwcontext_d3d11va.c avutil/imgutils: Add wrapper for av_image_copy() to avoid casts 2023-09-12 09:42:27 +02:00
hwcontext_d3d11va.h
hwcontext_d3d12va_internal.h libavutil: add hwcontext_d3d12va and AV_PIX_FMT_D3D12 2023-12-21 11:27:21 +01:00
hwcontext_d3d12va.c avutil/hwcontext_d3d12va: Use av_image_copy() wrapper 2024-02-07 23:21:58 +01:00
hwcontext_d3d12va.h libavutil: add hwcontext_d3d12va and AV_PIX_FMT_D3D12 2023-12-21 11:27:21 +01:00
hwcontext_drm.c
hwcontext_drm.h
hwcontext_dxva2.c avutil/imgutils: Add wrapper for av_image_copy() to avoid casts 2023-09-12 09:42:27 +02:00
hwcontext_dxva2.h
hwcontext_internal.h libavutil: add hwcontext_d3d12va and AV_PIX_FMT_D3D12 2023-12-21 11:27:21 +01:00
hwcontext_mediacodec.c avutil/hwcontext_mediacodec: fix backward compatibility 2023-01-26 23:31:37 +08:00
hwcontext_mediacodec.h avutil/hwcontext_mediacodec: fix backward compatibility 2023-01-26 23:31:37 +08:00
hwcontext_opencl.c avutil/hwcontext_opencl: Use proper OpenCLFramesContext 2024-02-13 18:55:22 +01:00
hwcontext_opencl.h
hwcontext_qsv.c lavu/hwcontext_qsv: use mfxImplDescription instead of mfxExtendedDeviceId on Linux 2023-12-05 10:11:19 +08:00
hwcontext_qsv.h
hwcontext_stub.c
hwcontext_vaapi.c avutil/hwcontext_vaapi: Allocate pub and priv frames hwctx together 2024-02-24 15:27:49 +01:00
hwcontext_vaapi.h
hwcontext_vdpau.c
hwcontext_vdpau.h
hwcontext_videotoolbox.c avutil/hwcontext_vt: add pixel format map for full range YUV420P 2024-01-13 12:33:47 +01:00
hwcontext_videotoolbox.h avutil/hwcontext_videotoolbox: add frame hwctx to specify color range 2024-01-04 20:51:17 +01:00
hwcontext_vulkan.c hwcontext_vulkan: guard unistd.h include 2023-12-11 23:53:59 +01:00
hwcontext_vulkan.h hwcontext_vulkan: rewrite to support multiplane surfaces 2023-05-29 00:41:49 +02:00
hwcontext.c avutil/hwcontext: Don't check before av_buffer_unref() 2024-02-25 12:06:40 +01:00
hwcontext.h libavutil: add hwcontext_d3d12va and AV_PIX_FMT_D3D12 2023-12-21 11:27:21 +01:00
iamf.c all: use designated initializers for AVOption.unit 2024-02-24 15:27:39 +01:00
iamf.h avutil/iamf: add some more doxy to structs 2024-02-07 23:21:48 +01:00
imgutils_internal.h
imgutils.c avutil/imgutils: fix half-float representation of 0.0625 2024-01-05 12:53:23 +01:00
imgutils.h avutil/imgutils: add new function av_image_fill_color() 2023-12-14 20:39:44 +01:00
integer.c avutil/integer: Use '|' instead of '+' where it is more natural 2022-10-24 20:11:20 +02:00
integer.h
internal.h avutil/internal: Don't auto-include emms.h 2023-09-04 11:04:45 +02:00
intfloat.h
intmath.c
intmath.h lavu/riscv: add <intmath.h> optimisations 2022-09-13 16:50:43 -03:00
intreadwrite.h avutil/intreadwrite: Remove obsolete warning 2024-02-24 15:27:47 +01:00
lfg.c
lfg.h avutil/lfg: Minor doxy improvements 2022-10-17 09:56:47 +02:00
libavutil.v
libm.h
lls.c
lls.h
log2_tab.c
log.c lavu/log: do not assume AVClass.item_name is always set 2023-11-09 11:25:17 +01:00
log.h
lzo.c
lzo.h
macos_kperf.c macos_kperf: fix incomplete prototype 2023-07-22 21:35:15 +03:00
macos_kperf.h
macros.h
Makefile libavutil: add hwcontext_d3d12va and AV_PIX_FMT_D3D12 2023-12-21 11:27:21 +01:00
mastering_display_metadata.c
mastering_display_metadata.h
mathematics.c Move bessel_i0() from swresample/resample to avutil/mathematics 2023-05-29 00:45:28 +02:00
mathematics.h Move bessel_i0() from swresample/resample to avutil/mathematics 2023-05-29 00:45:28 +02:00
md5.c avutil/mem: Don't include avutil.h 2023-09-07 00:42:10 +02:00
md5.h
mem_internal.h avutil/mem: limit alignment to maximum simd align 2024-03-01 19:21:12 +01:00
mem.c avutil/mem: limit alignment to maximum simd align 2024-03-01 19:21:12 +01:00
mem.h avutil/mem: Don't include avutil.h 2023-09-07 00:42:10 +02:00
motion_vector.h
murmur3.c avutil/mem: Don't include avutil.h 2023-09-07 00:42:10 +02:00
murmur3.h
objc.h
opt.c avutil/opt: Use correct function pointer type 2024-02-25 12:06:40 +01:00
opt.h all: Don't set AVClass.item_name to its default value 2023-12-22 16:49:25 +01:00
parseutils.c
parseutils.h avutil/parseutils: Use inline code and properly escape 2022-10-17 09:56:47 +02:00
pixdesc.c avutil/pixfmt: fix AV_PIX_FMT_RGB8 description 2024-02-07 23:21:49 +01:00
pixdesc.h avutil/pixdesc: add AV_PIX_FMT_FLAG_XYZ 2023-10-31 15:46:07 +01:00
pixelutils.c
pixelutils.h
pixfmt.h avutil/pixfmt: Add AV_VIDEO_MAX_PLANES 2024-02-24 15:27:40 +01:00
qsort.h
random_seed.c avutil/random_seed: turn off buffering when reading from random 2023-07-16 11:48:31 +02:00
random_seed.h avutil/random_seed: include stddef.h 2023-07-05 10:25:12 -07:00
rational.c avutil/rational: increase av_d2q precision 2024-02-07 23:22:15 +01:00
rational.h avutil/rational: Document what is to be expected from av_d2q() of doubles representing rational numbers 2024-02-12 18:18:30 +01:00
rc4.c
rc4.h avutil/rc4: Add doxy for missing arguments 2022-10-17 09:56:47 +02:00
replaygain.h
reverse.c
reverse.h
ripemd.c
ripemd.h
samplefmt.c avutil/samplefmt: Constify some pointees 2023-09-12 09:17:28 +02:00
samplefmt.h avutil/samplefmt: Constify some pointees 2023-09-12 09:17:28 +02:00
sfc64.h avutil/eval: Use even better PRNG 2024-02-07 23:44:20 +01:00
sha512.c
sha512.h
sha.c
sha.h
slicethread.c slicethread: Limit the automatic number of threads to 16 2022-09-06 18:46:44 +03:00
slicethread.h
softfloat_ieee754.h
softfloat_tables.h
softfloat.h avutil/softfloat: Basic documentation for av_sincos_sf() 2023-06-23 02:06:46 +02:00
spherical.c avutil/avstring: Remove obsolete version.h inclusion 2023-09-07 00:48:50 +02:00
spherical.h avutil/spherical: Add file to doxy group 2022-10-17 09:55:19 +02:00
stereo3d.c
stereo3d.h avutil/stereo3d: Add file to doxy group 2022-10-17 09:55:19 +02:00
tablegen.h
tea.c
tea.h
thread.h avutil/thread: fix pthread_setname_np parameters for NetBSD and Apple 2024-02-07 23:22:16 +01:00
threadmessage.c avutil/mem: Don't include avutil.h 2023-09-07 00:42:10 +02:00
threadmessage.h
time_internal.h
time.c
time.h
timecode.c
timecode.h libavutil/timecode: fix parameter order in documentation 2024-02-07 23:21:48 +01:00
timer.h timer: don't leak perf FD if zero 2023-07-22 21:35:15 +03:00
timestamp.h avutil/mem: Don't include avutil.h 2023-09-07 00:42:10 +02:00
tree.c
tree.h
twofish.c
twofish.h avutil/twofish: Fix doxy @param typo 2022-10-17 09:51:47 +02:00
tx_double.c
tx_float.c
tx_int32.c
tx_priv.h avutil/tx: add rader FFT algorithm support 2023-12-14 21:07:59 +01:00
tx_template.c avutil/tx_template: small reduction of number of multiplications 2024-01-11 17:49:07 +01:00
tx.c avutil/tx: print debug log at trace level 2024-02-24 15:27:53 +01:00
tx.h lavu/tx: add DCT-I and DST-I transforms 2023-09-01 23:59:10 +02:00
utils.c
uuid.c
uuid.h avutil/uuid: Remove bogus doxy return doc 2022-10-17 09:56:47 +02:00
version_major.h
version.c avutil/version: Remove outdated checks 2024-02-24 15:27:50 +01:00
version.h avutil/channel_layout: add av_channel_layout_custom_init() 2024-02-13 18:55:19 +01:00
video_enc_params.c lavu/video_enc_params: Avoid relying on an undefined C construct 2023-01-31 14:22:54 +02:00
video_enc_params.h avutil/video_enc_params: fix doxy for av_video_enc_params_block() 2023-10-30 10:30:05 -03:00
video_hint.c lavu: add video_hint API 2023-08-08 09:46:11 +02:00
video_hint.h lavu: add video_hint API 2023-08-08 09:46:11 +02:00
vulkan_functions.h vulkan: enable VK_KHR_cooperative_matrix 2023-08-26 23:14:53 +02:00
vulkan_loader.h vulkan: enable VK_KHR_cooperative_matrix 2023-08-26 23:14:53 +02:00
vulkan.c vulkan: return VK_NOT_READY when no queries are available 2023-10-28 21:16:15 +02:00
vulkan.h vulkan: return VK_NOT_READY when no queries are available 2023-10-28 21:16:15 +02:00
wchar_filename.h avutil/mem: Don't include avutil.h 2023-09-07 00:42:10 +02:00
xga_font_data.c
xga_font_data.h
xtea.c
xtea.h