1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-10 06:10:52 +02:00
Commit Graph

120269 Commits

Author SHA1 Message Date
Timo Rothenpieler
b6e808d28b avformat/tls_openssl: initialize DTLS context with correct method 2025-07-16 18:46:55 +02:00
Timo Rothenpieler
db0adbbd3f avformat/tls_openssl: don't abort if dtls has no key/cert set 2025-07-16 18:46:55 +02:00
Timo Rothenpieler
951013e603 avformat/tls_openssl: force dtls handshake to be blocking
There is no sensible way to handle this otherwise anyway, one just has
to loop over this function until it succeeds.
2025-07-16 18:46:55 +02:00
Timo Rothenpieler
87b09f3931 avformat/tls_openssl: set dtls remote addr in listen mode
Taken from the first received packet, which will signify the now
permanent peer of this DTLS "connection".
2025-07-16 18:46:55 +02:00
James Almer
9c55f22ef2 avcodec/ffv1dec: don't add offsets to NULL pointers
Fixes: libavcodec/ffv1dec.c:452:43: runtime error: applying zero offset to null pointer
Signed-off-by: James Almer <jamrial@gmail.com>
2025-07-15 10:24:09 -03:00
James Almer
307983b292 avformat/tls_schannel: add check for Windows 10 only types and defines
Old Mingw-w64 releases provided by some distros seemingly don't have them, so
check for them and disable the dtls protocol if unavailable.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-07-15 10:24:08 -03:00
Niklas Haas
053a113ad8 avutil/hwcontext_vulkan: don't over-map buffers with prior padding
If the image data is not at the start of the buffer allocation, such as
when the buffer has padding before the image data, this function maps too
much memory, since src_data + src_buf->size exceeds the buffer size.

Fix this by subtracting the difference between the buffer start and the
provided image data pointer from the size of the memory range to map.

An easy way to reproduce this issue is using the vf_pad filter, which
allocates image data buffers with a nonzero offset whenever padding is
requested before the start of the image data.
2025-07-15 12:46:11 +02:00
Lynne
bedfb6eca4 aacenc_tns: clamp filter direction energy measurement
The issue is that:

float en[2];
...
tns->n_filt[w] = is8 ? 1 : order != TNS_MAX_ORDER ? 2 : 3;
for (g = 0; g < tns->n_filt[w]; g++) {
    tns->direction[w][g] = slant != 2 ? slant : en[g] < en[!g];

When using the AAC Main profile, n_filt = 3, and slant is by
default 2 (normal long frames), g can go above 1.

en is the evolution of energy in the frequency domain for every
band at the given window. E.g. whether the energy is concentrated
at the top of each band, or the bottom.

For 2-pole filters, its straightforward.
For 3-pole filters, we need more than 2 measurements.

This commit properly implements support for 3-pole filters, by measuring
the band energy across three areas.

Do note that even xHE-AAC caps n_filt to 2, and only AAC Main allows
n_filt == 3.

Fixes https://trac.ffmpeg.org/ticket/11418
2025-07-15 16:27:31 +09:00
Kacper Michajłow
e9cd280dfe MAINTAINERS: add myself
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-15 00:59:46 +02:00
Marton Balint
fba1913d5a tests/fate: add fate test for excessive frame buffering when using filters
Based on the command line of ticket #10959.

Signed-off-by: Marton Balint <cus@passwd.hu>
2025-07-14 22:05:11 +02:00
Marton Balint
7d54fad868 fftools/ffmpeg: add support for setting maximum buffered frames in a filtergraph
Signed-off-by: Marton Balint <cus@passwd.hu>
2025-07-14 22:05:11 +02:00
Marton Balint
b24155cae1 avfilter/avfilter: add AVFilterGraph->max_buffered_frames to limit buffered frames
Signed-off-by: Marton Balint <cus@passwd.hu>
2025-07-14 22:05:10 +02:00
Marton Balint
71468e85ae avfilter/framequeue: add support for limiting and tracking buffered frames in the queues
Signed-off-by: Marton Balint <cus@passwd.hu>
2025-07-14 22:03:36 +02:00
Jiasheng Jiang
35a6de137a libavcodec/alsdec.c: Add check for av_malloc_array() and av_calloc()
Add check for the return value of av_malloc_array() and av_calloc()
to avoid potential NULL pointer dereference.

Fixes: dcfd24b10c ("avcodec/alsdec: Implement floating point sample data decoding")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-12 20:35:18 +02:00
Niklas Haas
0a5ae743ef avfilter/vf_thumbnail: switch to query_func2
Instead of enumerating a static list of planar formats to support, walk
through the format list and enable all supported formats.

As of writing, this generates the following format list:
- gbrap
- gbrap10le
- gbrap12le
- gbrap14le
- gbrap16le
- gbrp
- gbrp10le
- gbrp12le
- gbrp14le
- gbrp16le
- gbrp9le
- gray
- gray10le
- gray12le
- gray14le
- gray16le
- gray9le
- ya16le
- ya8
- yuv410p
- yuv411p
- yuv420p
- yuv420p10le
- yuv420p12le
- yuv420p14le
- yuv420p16le
- yuv420p9le
- yuv422p
- yuv422p10le
- yuv422p12le
- yuv422p14le
- yuv422p16le
- yuv422p9le
- yuv440p
- yuv440p10le
- yuv440p12le
- yuv444p
- yuv444p10le
- yuv444p12le
- yuv444p14le
- yuv444p16le
- yuv444p9le
- yuva420p
- yuva420p10le
- yuva420p16le
- yuva420p9le
- yuva422p
- yuva422p10le
- yuva422p12le
- yuva422p16le
- yuva422p9le
- yuva444p
- yuva444p10le
- yuva444p12le
- yuva444p16le
- yuva444p9le
- yuvj411p
- yuvj420p
- yuvj422p
- yuvj440p
- yuvj444p
2025-07-12 12:52:33 +02:00
Niklas Haas
cf18b280f0 avfilter/vf_thumbnail: support more planar formats
This adds support for high bit depth formats, as well as formats with fewer
than 3 planes. The implementation for HBD is the same as for 8 bit formats,
just right shifted to 8 bits.

It's worth pointing out that this also works for HDR formats (and even DV),
because the underlying implementation is just trying to minimize the histogram
difference. If anything, using a HDR format will result in a *more* accurate
detection, because HDR formats tend to be more perceptually uniform.
2025-07-12 12:52:33 +02:00
Timo Rothenpieler
3ce348063c avcodec/nvdec: switch to proper pixfmts on next major bump 2025-07-11 17:49:58 +02:00
Timo Rothenpieler
8304a1abc7 avcodec/nvenc: add support for new 10 bit MSB pixel formats 2025-07-11 17:49:58 +02:00
Timo Rothenpieler
02a7c85753 swscale: add support for new 10/12 bit MSB formats 2025-07-11 17:49:58 +02:00
Timo Rothenpieler
e93de9948d avutils/pixfmt: add YUV444/GBRP 10 and 12 bit MSB formats 2025-07-11 17:49:58 +02:00
Jorge Estrada
cd91469114 avfilter/overlay_cuda: add timeline editing support
Enables timeline editing options for overlay_cuda similar to what overlay allows

Example overlaying an image on a video between 30 to 60 seconds:

ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i sample-video.mp4 -i sample-image.jpg
-filter_complex "[1:v]hwupload_cuda[image],[0:v]scale_npp=format=yuv420p[video],[video][image]overlay_cuda=enable='between(t,30,60)'"
-c:v h264_nvenc -c:a copy -y overlay-output-gpu.mp4

Signed-off-by: Jorge Estrada <jestrada.list@gmail.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2025-07-11 17:49:58 +02:00
Timo Rothenpieler
9b6638e125 avformat/tls_schannel: fix non-blocking write breaking TLS sessions 2025-07-11 17:49:58 +02:00
Timo Rothenpieler
9cd86c431b avformat/tls_schannel: add option to load server certificate from store 2025-07-11 17:49:57 +02:00
Timo Rothenpieler
90fa9636ef avformat/tls_schannel: add DTLS support 2025-07-11 17:49:57 +02:00
Timo Rothenpieler
6af099522e avformat/tls: make passing an external socket universal 2025-07-11 17:49:57 +02:00
Timo Rothenpieler
2604c86c1f avformat/udp: add function to set remote address directly 2025-07-11 17:49:57 +02:00
Timo Rothenpieler
585cae13fa avformat/udp: separate rx and tx fifo 2025-07-11 17:49:57 +02:00
Timo Rothenpieler
af04a27893 avformat/udp: make recv addr of each packet available 2025-07-11 17:49:57 +02:00
Timo Rothenpieler
2c7e117fe0 avformat/tls: move whip specific init out of generic tls code 2025-07-11 17:49:57 +02:00
Marvin Scholz
7c91ae9419 avformat/rtsp: check copy_tls_opts_dict
Properly check av_dict_set return values and propagate them to
the caller so they can be handled.
2025-07-11 16:32:05 +02:00
Marvin Scholz
c4e8ac3d0e avformat/rtsp: use av_unreachable 2025-07-11 16:32:05 +02:00
Marvin Scholz
c425951c05 avformat/rtsp: fix misleading indentation 2025-07-11 16:32:05 +02:00
Andreas Rheinhardt
fadadb56e6 avcodec/mpegvideo_dec: Avoid implicit NULL + offset
Happens since 4fc874ef08
when this code is called via error resilience.
Also do the same for wmv2dec.c.
Fixes the vsynth_{1,2,3,_lena}-mpeg4-error and wmv2-drm-dec FATE-tests.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-11 15:14:36 +02:00
Andreas Rheinhardt
9139edfdd3 avcodec/opus/dec: Simplify resetting AVAudioFifo
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-11 15:14:27 +02:00
Andreas Rheinhardt
66f29ae9b6 avcodec/opus/dec: Don't call function multiple times in FFMAX
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-11 15:14:21 +02:00
Andreas Rheinhardt
faf0d81309 avcodec/opus/dec: Remove unused parameters
The parameters here are not only unused, but buf_size's value
is actually wrong when flushing (it comes from the subpacket
of the last packet sent and is therefore outdated).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-11 15:14:14 +02:00
Andreas Rheinhardt
ba2c9acedb avcodec/get_bits: Remove GetBitContext.buffer_end
It is unused. Furthermore, this automatically fixes the issue
that init_get_bits() failure would lead to NULL + 0 (when
setting buffer_end) which is UB before C23. This happened
in the fic-avi and fic-avi-skip_cursor FATE-tests.

This saved 7296B of .text here.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-11 15:13:21 +02:00
Andreas Rheinhardt
367cf961ea avcodec/get_bits: Add get_bits_bytesize()
And use it to avoid accesses to GetBitContext.buffer_end.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-11 15:13:21 +02:00
Andreas Rheinhardt
d20a4ef93c avcodec/vvc/dec: Don't use GetBit-API when byte-aligned
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-11 15:13:21 +02:00
Andreas Rheinhardt
d19b88f570 avcodec/bytestream: Add const where appropriate
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-07-11 15:13:21 +02:00
Kacper Michajłow
3334bdc6e7 avformat/scd: ensure SCD_MIN_HEADER_SIZE bytes are read
Instead of accessing unintialized data when input is shorter than
expected size.

Fixes use of uninitialized value in MSAN build.
Found by OSS-Fuzz.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-07-11 01:23:58 +02:00
James Almer
1787fade20 fftools/ffmpeg_demux: don't flag timestamps as unreliable if they are generated
Regardless of the source being an AVFMT_NOTIMESTAMPS format, if the timestamps
are generated like when using the use_wallclock_as_timestamps demuxer option,
then they are reliable.

Fixes ticket #11268

Signed-off-by: James Almer <jamrial@gmail.com>
2025-07-10 11:13:36 -03:00
Marvin Scholz
82aeee3c19 avformat/rtsp: fix leak of options dict on error
Fix CID 1655306

Reviewed-by: Kieran Kunhya <kierank@obe.tv>
2025-07-10 13:16:08 +02:00
Peter Ross
853ad9e77e avcodec/adpcm: squelch uninitialized variable warnings
Fixes CID1655273 and CID1655274.

Signed-off-by: Marvin Scholz <epirat07@gmail.com>
2025-07-10 13:01:15 +02:00
Desmond Liu
060fc4e3a5 doc/scaler.texi: add missing gamma option
Add missing 'gamma correct scaling' option to documentation.

Signed-off-by: Desmond Liu <desmond.liu@netint.ca>
2025-07-08 16:05:22 +05:30
Marvin Scholz
0dedef1557 avformat/tls: rename accidentally changed options
These were accidentally renamed back to the old names in
ba9817df9d

Reviewed-by: Timo Rothenpieler <timo@rothenpieler.org>
2025-07-08 00:16:21 +02:00
Marvin Scholz
50cae8ad76 Changelog: mention dropping OpenSSL < 1.1.0 2025-07-07 20:53:54 +02:00
Dawid Kozinski
219f234e07 avformat/mov: add support for APV streams
Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2025-07-07 13:37:24 -03:00
Marvin Scholz
934e1c23b0 APIchanges: Add entry for AV_PKT_DATA_RTCP_SR 2025-07-07 17:19:44 +02:00
Marvin Scholz
eca477da52 avcodec: bump minor after adding AV_PKT_DATA_RTCP_SR 2025-07-07 17:18:48 +02:00