ffmpeg/libavutil
Andreas Rheinhardt 731c775898 avutil/mem: Use max_alloc_size as-is
The size of a single allocation performed by av_malloc() or av_realloc()
is supposed to be bounded by max_alloc_size, which defaults to INT_MAX
and can be set by the user; yet currently this is not completely
honoured: The actual value used is max_alloc_size - 32. How this came
to be can only be understood historically:

a) 0ecca7a49f disallowed allocations
> INT_MAX. At that time the size parameter of av_malloc() was an
unsigned and the commentary added ("lets disallow possible ambiguous
cases") indicates that this was done as a precaution against calling the
functions with negative int values. Genuinely limiting the size of
allocations to INT_MAX doesn't seem to have been the intention given
that at this time the memalign hack introduced in commit
da9b170c6f (which when enabled increased
the size of allocations slightly so that one can return a correctly
aligned pointer that actually does not point to the beginning of the
allocated buffer) was already present.
b) Said memalign hack allocated 17 bytes more than actually desired, yet
allocating 16 bytes more is actually enough and so this was changed in
a9493601638b048c44751956d2360f215918800c; this commit also replaced
INT_MAX by INT_MAX - 16 (and made the limit therefore a limit on the size
of the allocated buffer), but kept the comment, although there is nothing
ambiguous about allocating (INT_MAX - 16)..INT_MAX.
c) 13dfce3d44 then increased 16 to 32 for
AVX, 6b4c0be558 replaced INT_MAX by
MAX_MALLOC_SIZE (which was of course defined to be INT_MAX) and
5a8e994287 added max_alloc_size and made
it user-selectable.
d) 4fb311c804 then dropped the memalign
hack, yet it kept the -32 (probably because the comment about ambiguous
cases was still present?), although it is no longer needed at all after
this commit. Therefore this commit removes it and uses max_alloc_size
directly.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-05-26 06:47:31 +02:00
..
aarch64 aarch64: Explicitly forbid using the x18 register 2020-05-15 21:22:22 +03:00
arm
avr32
bfin
mips avcodec/mips: msa optimizations for vc1dsp 2019-10-30 18:09:00 +01:00
ppc
sh4
tests avutil/tests/opt: add av_opt_get/av_opt_set tests 2019-12-27 21:52:21 +01:00
tomi
x86 libavutil: x86: Include stdlib.h before using _byteswap_ulong 2020-01-23 18:30:26 +02:00
.gitignore
adler32.c
adler32.h
aes_ctr.c
aes_ctr.h
aes_internal.h
aes.c
aes.h
attributes.h
audio_fifo.c
audio_fifo.h
avassert.h
avsscanf.c
avstring.c avutil/avstring: Fix warning: ISO C90 forbids mixed declarations and code 2020-01-14 19:19:30 +01:00
avstring.h avutil/avstring: support input path as a null pointer or empty string 2019-10-08 14:12:43 +08:00
avutil.h
avutilres.rc
base64.c
base64.h
blowfish.c
blowfish.h
bprint.c
bprint.h
bswap.h
buffer_internal.h
buffer.c avutil/buffer: add av_buffer_pool_buffer_get_opaque 2019-12-26 00:47:24 +01:00
buffer.h avutil/buffer: add av_buffer_pool_buffer_get_opaque 2019-12-26 00:47:24 +01:00
camellia.c
camellia.h
cast5.c
cast5.h
channel_layout.c
channel_layout.h
color_utils.c
color_utils.h
colorspace.h
common.h avutil/common: Add saturated add/sub operations for int64_t. 2020-05-15 22:03:36 +02:00
cpu_internal.h
cpu.c
cpu.h
crc.c
crc.h
cuda_check.h
des.c
des.h
dict.c
dict.h
display.c
display.h
dovi_meta.c lavutil: add DOVI related header 2020-04-23 08:05:15 +08:00
dovi_meta.h lavutil: add DOVI related header 2020-04-23 08:05:15 +08:00
downmix_info.c
downmix_info.h
dynarray.h
encryption_info.c avutil/encryption_info: Don't pass NULL to memcpy 2019-09-20 23:26:34 +02:00
encryption_info.h
error.c
error.h
eval.c avutil/eval: Add av_expr_count_func() similar to av_expr_count_vars() 2019-12-28 11:20:48 +01:00
eval.h avutil/eval: Add av_expr_count_func() similar to av_expr_count_vars() 2019-12-28 11:20:48 +01:00
ffmath.h
fifo.c
fifo.h
file_open.c
file.c avutil/file: add more check befor destory the buffer 2019-08-30 09:16:01 +08:00
file.h
fixed_dsp.c
fixed_dsp.h
float_dsp.c
float_dsp.h
frame.c Stop hardcoding align=32 in av_frame_get_buffer() calls. 2020-05-22 14:38:57 +02:00
frame.h libavutil: add API for exporting video frame quantizers 2020-05-12 09:37:47 +02:00
hash.c
hash.h
hdr_dynamic_metadata.c
hdr_dynamic_metadata.h
hmac.c
hmac.h
hwcontext_cuda_internal.h avutil/hwcontext_cuda: allow using primary CUDA device context 2019-11-26 16:24:40 +01:00
hwcontext_cuda.c hwcontext: add av_hwdevice_ctx_create_derived_opts 2020-05-23 19:07:26 +01:00
hwcontext_cuda.h avutil/hwcontext_cuda: allow using primary CUDA device context 2019-11-26 16:24:40 +01:00
hwcontext_d3d11va.c avutil/hwcontext_d3d11va: Use secure dlopen. 2020-02-15 23:53:54 +11:00
hwcontext_d3d11va.h
hwcontext_drm.c
hwcontext_drm.h
hwcontext_dxva2.c
hwcontext_dxva2.h
hwcontext_internal.h hwcontext: add av_hwdevice_ctx_create_derived_opts 2020-05-23 19:07:26 +01:00
hwcontext_mediacodec.c
hwcontext_mediacodec.h
hwcontext_opencl.c hwcontext: add av_hwdevice_ctx_create_derived_opts 2020-05-23 19:07:26 +01:00
hwcontext_opencl.h
hwcontext_qsv.c hwcontext: add av_hwdevice_ctx_create_derived_opts 2020-05-23 19:07:26 +01:00
hwcontext_qsv.h
hwcontext_vaapi.c hwcontext: add av_hwdevice_ctx_create_derived_opts 2020-05-23 19:07:26 +01:00
hwcontext_vaapi.h
hwcontext_vdpau.c
hwcontext_vdpau.h
hwcontext_videotoolbox.c avcodec/videotoolbox: add support for full range pixel formats 2019-09-04 10:51:20 -07:00
hwcontext_videotoolbox.h avcodec/videotoolbox: add support for full range pixel formats 2019-09-04 10:51:20 -07:00
hwcontext_vulkan.c hwcontext_vulkan: move physical device feature discovery to device_init 2020-05-23 19:07:46 +01:00
hwcontext_vulkan.h hwcontext_vulkan: do not OR the user-specified usage with our default flags 2020-05-23 19:07:41 +01:00
hwcontext.c hwcontext: add av_hwdevice_ctx_create_derived_opts 2020-05-23 19:07:26 +01:00
hwcontext.h hwcontext: add av_hwdevice_ctx_create_derived_opts 2020-05-23 19:07:26 +01:00
imgutils_internal.h
imgutils.c
imgutils.h
integer.c
integer.h
internal.h
intfloat.h
intmath.c
intmath.h
intreadwrite.h
lfg.c
lfg.h avutil/lfg: Correct index increment type to avoid undefined behavior 2019-11-24 22:58:59 +01:00
libavutil.v
libm.h
lls.c
lls.h
log2_tab.c
log.c avutil/log: update text requesting samples 2020-04-17 00:08:56 +02:00
log.h avutil/log: Add av_log_once() for printing a message just once with a high log level 2020-02-12 10:25:25 +01:00
lzo.c
lzo.h
macros.h
Makefile libavutil: add API for exporting video frame quantizers 2020-05-12 09:37:47 +02:00
mastering_display_metadata.c
mastering_display_metadata.h
mathematics.c avutil/mathematics: Fix 2 overflows in av_add_stable() 2019-08-31 18:34:05 +02:00
mathematics.h
md5.c
md5.h
mem_internal.h
mem.c avutil/mem: Use max_alloc_size as-is 2020-05-26 06:47:31 +02:00
mem.h
motion_vector.h
murmur3.c
murmur3.h
opt.c avutil/opt: add AV_OPT_FLAG_CHILD_CONSTS 2020-05-22 22:16:52 +02:00
opt.h avutil/opt: add AV_OPT_FLAG_CHILD_CONSTS 2020-05-22 22:16:52 +02:00
parseutils.c
parseutils.h
pca.c
pca.h
pixdesc.c lavu/pix_fmt: add new pixel format y210 2020-02-24 00:09:51 +00:00
pixdesc.h
pixelutils.c
pixelutils.h
pixfmt.h lavu/pix_fmt: add new pixel format y210 2020-02-24 00:09:51 +00:00
qsort.h
random_seed.c
random_seed.h
rational.c lavu: add av_gcd_q(). 2020-05-23 15:51:44 +02:00
rational.h lavu: add av_gcd_q(). 2020-05-23 15:51:44 +02:00
rc4.c
rc4.h
replaygain.h
reverse.c
reverse.h
ripemd.c
ripemd.h
samplefmt.c
samplefmt.h
sha512.c
sha512.h
sha.c
sha.h
slicethread.c
slicethread.h
softfloat_ieee754.h
softfloat_tables.h
softfloat.h
spherical.c
spherical.h
stereo3d.c
stereo3d.h
tablegen.h
tea.c
tea.h
thread.h avutil/thread: fix strict_pthread_cond_timedwait 2020-01-25 23:16:18 +01:00
threadmessage.c
threadmessage.h
time_internal.h
time.c
time.h
timecode.c
timecode.h
timer.h
timestamp.h
tree.c
tree.h
twofish.c
twofish.h
tx_double.c
tx_float.c
tx_int32.c lavu/tx: implement 32 bit fixed point FFT and MDCT 2020-02-13 17:10:34 +00:00
tx_priv.h lavu/tx: improve 3-point fixed precision 2020-02-14 19:58:14 +00:00
tx_template.c lavu/tx: add 2-point FFT transform 2020-03-23 21:26:25 +00:00
tx.c lavu/tx: implement 32 bit fixed point FFT and MDCT 2020-02-13 17:10:34 +00:00
tx.h lavu/tx: add 2-point FFT transform 2020-03-23 21:26:25 +00:00
utils.c Silence "string-plus-int" warning shown by clang. 2020-01-06 22:38:56 +01:00
version.h h264dec: support exporting QP tables through the AVVideoEncParams API 2020-05-25 11:59:42 +02:00
video_enc_params.c libavutil: add API for exporting video frame quantizers 2020-05-12 09:37:47 +02:00
video_enc_params.h h264dec: support exporting QP tables through the AVVideoEncParams API 2020-05-25 11:59:42 +02:00
wchar_filename.h
xga_font_data.c
xga_font_data.h
xtea.c
xtea.h