Commit graph

124449 commits

Author SHA1 Message Date
Marvin Scholz
7e045dfbfc ffprobe: implement printing IAMF frame side data 2026-05-13 15:19:11 +02:00
Marvin Scholz
65635453cb avcodec: map IAMF packet side data to frame side data 2026-05-13 15:19:11 +02:00
Marvin Scholz
99908c6e05 avutil: add IAMF frame side data types
These contain the same data as the packet side data equivalents.
2026-05-13 15:19:11 +02:00
jiangjie
22d06b39ce avfilter/avfilter: fix memory leak of filter name in ff_filter_alloc error path
When ff_filter_alloc fails after the name has been allocated (via
av_strdup), the error handling code frees inputs and input_pads but
misses freeing ret->name, causing a memory leak.

Add av_freep(&ret->name) in the error path before freeing inputs.
2026-05-13 20:11:19 +08:00
Marvin Scholz
4851060ccd avutil: hdr_dynamic_metadata: fix error code
When s is NULL in av_dynamic_hdr_smpte2094_app5_from_t35, that's not an
allocation error but just invalid API usage. If there is any allocation
failure beforehand that would lead to this, the caller has to check it,
like is already done in all usages of this function in FFmpeg itself.
2026-05-12 17:18:38 +02:00
Marvin Scholz
37ff8fad47 avutil: hdr_dynamic_metadata: handle allocation failure
Handle allocation failure properly in
av_dynamic_hdr_smpte2094_app5_from_t35.

Fixes Coverity issue #1691448
2026-05-12 17:18:38 +02:00
Marvin Scholz
3dbc3c6954 avcodec/libvorbisenc: conditionally set initial_padding
Only set initial_padding when vorbis_analysis_blockout succeeds,
this avoids passing uninitialized data/garbage pointer to
av_vorbis_parse_frame.

Fix Coverity Issue 1681345
2026-05-12 15:17:28 +00:00
Andreas Rheinhardt
c29d1b9df5 avformat/id3v2: Fix indentation
Forgotten after e9c372362c.

Reviewed-by: Romain Beauxis <toots@rastageeks.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-05-12 16:12:54 +02:00
Andreas Rheinhardt
356e427d5c avformat/id3v2: Use proper logcontext
Otherwise one could not associate log messages with inputs.

Reviewed-by: Romain Beauxis <toots@rastageeks.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-05-12 16:12:51 +02:00
Andreas Rheinhardt
e626b02a01 avformat/id3v2: Avoid temporary buffer
Reviewed-by: Romain Beauxis <toots@rastageeks.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-05-12 16:11:56 +02:00
Marvin Scholz
18761f9fb5 avformat/rtpdec_av1: fix buffer overflow due to variable confusion
The pktpos denotes the position in the output packet buffer, while
buf_ptr is the position in the input buffer. As this payload is ignored,
nothing is written to the output packet so increasing the pktpos does
not make sense here, instead the buf_ptr has to be increased to advance
the input buffer to the correct position after this OBU.

This incorrect increment here could result in pktpos exceeding the whole
size of the output packet and the later call to memcpy to write to that
buffer would start its write way past the end of the packet buffer.

Fix #22812

Reported-By: fre3dm4n
2026-05-12 16:02:51 +02:00
nyanmisaka
d01d18ad71 vulkan: fix using encode caps before querying
Fix using enc_caps.supportedEncodeFeedbackFlags before
calling vkGetPhysicalDeviceVideoCapabilitiesKHR().

Otherwise the check will never pass and will fail with ENOTSUP.

Fixes 3f9e04b

Signed-off-by: nyanmisaka <nst799610810@gmail.com>
2026-05-12 11:28:09 +00:00
David Rosca
6b3e0f903e vulkan_encode: Fix description for quality option
From spec:
  Generally, using higher video encode quality levels may produce
  higher quality video streams at the cost of additional processing time.
2026-05-12 09:14:34 +00:00
Vignesh Venkat
2c1af16872 avformat/matroskaenc: Use correct buffer for smpte2094_app5
In the call to mkv_write_blockadditional, use the correct
buffer for smpte2094_app5.

Commit 38df985fba updated the
buffer usage to prevent incorrect buffer reuse, but left this line
unchanged inadvertently.

Signed-off-by: Vignesh Venkat <vigneshv@google.com>
2026-05-11 14:44:25 -07:00
Vignesh Venkat
e1797cdd51 avcodec/libvpxenc: Copy Smpte2094App5 metadata
If incoming packets contain Smpte2094App5 metadata, retain them
so that they are passed through to the output.

Signed-off-by: Vignesh Venkat <vigneshv@google.com>
2026-05-11 20:17:11 +00:00
Niklas Haas
c1ff2c24b5 swscale/filters: hard-code radius for trivial kernels
box() and triangle() have well-defined, trivially verifiable numerical
inverses.

We could actually pre-compute and hard-code the numerical inverse of all
non-parametric kernels, but I'm a bit reluctant to do this as I have plans to
adjust the value of SWS_MAX_REDUCE_CUTOFF based on the desired bit depth of the
output, which makes a hard-coding approach unfeasible.

(It would also be a brittle solution that may break whenever we extend the
scaler configuration API, as well as making it harder to add new filters)

Signed-off-by: Niklas Haas <git@haasn.dev>
2026-05-11 19:59:39 +02:00
Nariman-Sayed
837cf8e38f avformat/tls_mbedtls: fix DTLS handshake failure when receiving non-DTLS packets
Some WebRTC servers such as Pion send STUN packets concurrently during
the DTLS handshake. Unlike OpenSSL and GnuTLS which filter non-DTLS
packets internally, mbedtls passes all received UDP packets directly to
its DTLS state machine, causing the handshake to fail.

Fix this by using ff_is_dtls_packet() in mbedtls_recv to discard
non-DTLS packets such as STUN by returning WANT_READ, as specified
by RFC 5764 Section 5.1.2.

Signed-off-by: Nariman-Sayed <narimansayed28@gmail.com>
2026-05-11 12:36:58 +00:00
Nariman-Sayed
094f72748d avformat/tls: move DTLS packet detection into ff_is_dtls_packet()
Move the DTLS packet detection logic from whip.c into a shared
ff_is_dtls_packet() function in tls.c, with its declaration and
related macros in tls.h. Update whip.c to use the new shared function.

Signed-off-by: Nariman-Sayed <narimansayed28@gmail.com>
2026-05-11 12:36:58 +00:00
Kacper Michajłow
17bc88e67f avformat/hls: disable http_persistent/http_multiple with custom io_open
Both rely on the AVIOContext being backed by the builtin URLContext.
When the API user overrides io_open, the keepalive path asserts on the
missing URLContext and the http_multiple auto-detect probe fails on
every read. http_multiple=1 still works even with custom IO.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2026-05-11 09:00:31 +00:00
Lynne
fd25b35dd2
vulkan_ffv1: support decoding 32-bit float video
Sponsored-by: Sovereign Tech Fund
2026-05-11 05:32:41 +09:00
jiangjie
a67c15dfa5 avutil/hwcontext_vulkan: fix resource leak on alloc_mem failure
Fix by using goto fail so that vulkan_frame_free() properly cleans up
all previously created resources.
2026-05-10 20:01:47 +00:00
Andreas Rheinhardt
f16ec8913e avcodec/h264_cavlc: Fix indentation
Forgotten after 8d6947bc7d.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-05-10 17:16:38 +02:00
Dale Curtis
5bbc00c05d [Wave] Fix issues with unaligned metadata chunks.
Fixes corruption issues with the sample in this PR.

Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
2026-05-10 01:18:09 +00:00
Michael Niedermayer
188461be10 avformat/mpegts: Dont assume fc->priv_data is a MpegTSContext
Fixes: out of array access
Fixes: 508365271/clusterfuzz-testcase-minimized-ffmpeg_dem_WTV_fuzzer-6219535958212608

Regression since: b9cb948ec1

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-05-09 18:35:08 +00:00
James Almer
b2dfc14276 avcodec/vvc_parser: properly split PUs when a Prefix SEI NUT is found
Signed-off-by: James Almer <jamrial@gmail.com>
2026-05-09 11:44:39 -03:00
James Almer
2948acd528 avformat/nal: take into account removed zero bytes when calculating buffer size in nal_parse_units()
Fixes issue #23010

Signed-off-by: James Almer <jamrial@gmail.com>
2026-05-09 11:28:46 -03:00
jiangjie
2f4ad2497e avformat/movenc: fix dynamic buffer leaks on error paths
In mov_write_iacb_tag(), the dynamic buffer dyn_bc was leaked when
ff_iamf_write_descriptors() failed.

In mov_write_track_udta_tag(), the dynamic buffer pb_buf was leaked
when mov_write_track_kinds() failed, as the error path returned
directly instead of going through cleanup.

Fix both by ensuring ffio_free_dyn_buf() is called on all error paths.
2026-05-09 19:27:17 +08:00
Zhao Zhili
180a10647d avformat/tee: clean up local resources on program copy failure
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2026-05-09 10:46:35 +00:00
Vignesh Venkat
8518599cd1 avformat/matroskaenc: Write additional mappings for webm
The elements written in mkv_write_blockadditionmapping
(MaxBlockAdditionID, BlockAddIDType and BlockAddIDValue) are all
allowed in WebM as well. Move them out of the "if (!IS_WEBM)"
block.

Matroska spec:
https://www.matroska.org/technical/elements.html#MaxBlockAdditionID
(See column with title "W" which shows WebM availability).

WebM spec:
https://www.webmproject.org/docs/container/#MaxBlockAdditionID

Signed-off-by: Vignesh Venkat <vigneshv@google.com>
2026-05-08 13:33:31 -07:00
Andreas Rheinhardt
c8a4770599 avcodec/vc1dsp: Consistently use ptrdiff_t for stride
Also do the same in the x86 MMX code and its MIPS MMI clone.

Reviewed-by: Ramiro Polla <ramiro.polla@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-05-08 13:28:34 +02:00
Andreas Rheinhardt
ff0ad0278d avcodec/cbs: Move ff_cbs_all_codec_ids to cbs_bsf
Only used as AVBitStreamFilter.codec_ids. This avoids duplicating
it into lavf.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-05-08 09:35:38 +02:00
Andreas Rheinhardt
b6d2a0fc66 configure: Add missing apv_metadata->cbs_apv dependency
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-05-08 09:35:35 +02:00
Andreas Rheinhardt
6a59c847b5 configure: Redo enabling cbs in lavf
Right now, the cbs_type_table (the table of all CodedBitstreamTypes
supported by CBS) is empty unless cbs_apv and cbs_av1 is enabled.
The latter are only enabled in configure if they are needed in lavc.
This means that the mov muxers (the only users of cbs-in-lavf)
don't work as they should depending upon the availability of
e.g. the av1_metadata BSF. The table being empty is also illegal C
and according to PR #23038 MSVC warns about this (as does GCC
with -pedantic) and it may even lead to an internal compiler error.

This could be fixed by simply adding a mov_muxer->cbs_av1,cbs_apv
dependency in configure, yet this would have the downside that
it would force cbs_av1 and cbs_apv to be built for lavc, too,
even though it may not be needed there. So add new configure
variables cbs_{apv,av1}_lavf and cbs_lavf to track this correctly.

Reported-by: xiaozhuai <798047000@qq.com>
Reviewed-by: James Almer <jamrial@gmail.com>
Reviewed-by: xiaozhuai <798047000@qq.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-05-08 09:34:52 +02:00
Manuel Lauss
0f45541e04 avcodec/sanm: extend the codec37 mv table to 3x512 entries
the c37_mv table is 3x 510-entry tables combined.  Extend each
with a coordinate pair for index 0xff, which allows to eliminate
the index check in the code37/48 block handlers.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
2026-05-08 05:08:22 +00:00
Manuel Lauss
b418da28bf avcodec/sanm: fobj: apply the x/y offsets after size determination
Otherwise a wrong size might be determined.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
2026-05-08 05:08:22 +00:00
Manuel Lauss
01d895340c avcodec/sanm: accept fixed dimensions for ANIM at decode_init
This undoes 556cef27d9, which I added to fix a fuzzer-crash,
but there's no reason to expect the decoder can only be invoked
via the smush demuxer.  Instead also accept a range of dimensions
from 2x2 up to 640x480.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
2026-05-08 05:08:22 +00:00
Manuel Lauss
d1577bc018 avcodec/sanm: fobj codec37+: reject too large frames.
For the diff-buffer codecs, return error for frames that are larger
than the currently configured canvas.  This mimics the behaviour
of the DOS smush engines.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
2026-05-08 05:08:22 +00:00
Manuel Lauss
cc2f9ff14f avcodec/sanm: fobj: do not use codec-id to determine canvas size.
Codec>=37 with smaller dimensions can be embedded onto larger canvasses;
it makes no sense to trust their dimensions explicitly.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
2026-05-08 05:08:22 +00:00
Yong Yu
9ab345b2d1 fftools/graph: Add missing include "libavutil/mem.h" for fftools/graph/graphprint.c
when HAVE_AV_CONFIG_H is defined, include libavutil/mem.h
is skipped in libavutil/common.h.
Need this header file to build successfully.
2026-05-07 22:00:38 +00:00
Romain Beauxis
0f2e693956 tests/fate/id3v2.mak: add new tests for comm, lyrics, txx and wma
comments.

Signed-off-by: Romain Beauxis <romain.beauxis@gmail.com>
2026-05-07 09:46:53 -05:00
Romain Beauxis
85cc813412 libavformat/tests/id3v2: add test program for raw ID3v2 frame debugging
Signed-off-by: Romain Beauxis <romain.beauxis@gmail.com>
2026-05-07 09:46:37 -05:00
Romain Beauxis
910d796430 libavformat/id3v2: wire FF_FDEBUG_ID3V2 frame debugging
Signed-off-by: Romain Beauxis <romain.beauxis@gmail.com>
2026-05-07 09:46:17 -05:00
Michael Niedermayer
b5c7c7d273 avcodec/cbs_h266_syntax_template: tighten sh_num_tiles_in_slice_minus1 upper bound
Fixes: out of array access

Found-by: Vishal Panchani
Fix suggested by: Vishal Panchani
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-05-07 13:08:34 +00:00
Zhao Zhili
a17e96b103 avcodec/hevc: scope missing-ref loop counters locally 2026-05-07 13:01:16 +00:00
Zhao Zhili
3b939ced79 avcodec/hevc: limit missing-ref fill to coded planes
generate_missing_ref walked frame->f->data[] until a NULL slot, which
on alpha-video frames extended to data[3] and read
sps->hshift[3]/vshift[3] out of bounds.

The alpha plane is produced by the alpha layer via
replace_alpha_plane; the base decoder path never reads or writes it.
Bound the fill loop by the SPS coded plane count. This both removes
the out-of-bounds shift access and avoids an unnecessary full-frame
memset of the alpha plane.

Fixes: out of array read
Fixes: 500770604/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-6157374833623040

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
2026-05-07 13:01:16 +00:00
牟凡
28ecb07e55
avcodec/cbs_h266: fix wrong condition for chroma MTT depth in PH
In the picture header parser, the chroma branch incorrectly tested
sps_max_mtt_hierarchy_depth_intra_slice_chroma to decide whether to
parse ph_log2_diff_max_{bt,tt}_min_qt_intra_slice_chroma.

Per ITU-T H.266 (V4, 01/2026) section 7.3.2.8 "Picture header
structure syntax", the condition is on the just-parsed
ph_max_mtt_hierarchy_depth_intra_slice_chroma, exactly mirroring the
luma branch a few lines above and the inter-slice branch below.
sps_partition_constraints_override_enabled_flag allows the picture
header to override the SPS values, so testing the SPS field is
incorrect and desynchronises the parser whenever the PH override
changes the chroma MTT depth from/to zero.

Signed-off-by: Mou Fan <moufan17@126.com>
2026-05-07 10:42:44 +01:00
Andreas Rheinhardt
f2e5eff3ff avcodec/atsc_a53: Avoid GetBits API to parse A53 CC data
This fixes overreads with libdav1d, because it provides
non-padded data in violation to the requirements of
the GetBits API.

Furthermore, using the GetBits API here is wasteful,
as the offsets here are known and the actual data to be copied
is even byte-aligned, allowing to use memcpy.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-05-06 15:27:21 +02:00
ldm0
17734f6967 doc/examples/demux_decode: update ffplay command for audio and video output
Signed-off-by: ldm0 <liudingming@bytedance.com>
2026-05-05 23:44:42 +00:00
Dale Curtis
256d93413f avformat/mov: Fix negative index given to can_seek_to_key_sample()
The potentially negative return value of av_index_search_timestamp()
wasn't being handled before passing it to can_seek_to_key_sample().

Found by Wongi Lee (@_qwerty_po) of Theori with Xint Code,
Jungwoo Lee (@physicube).

Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
2026-05-05 21:26:38 +00:00
Andreas Rheinhardt
5c44245878 avutil/hwcontext_vulkan: Fix shadowing
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-05-05 12:46:26 +02:00