Commit graph

54144 commits

Author SHA1 Message Date
Marvin Scholz
65635453cb avcodec: map IAMF packet side data to frame side data 2026-05-13 15:19:11 +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
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
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
Lynne
fd25b35dd2
vulkan_ffv1: support decoding 32-bit float video
Sponsored-by: Sovereign Tech Fund
2026-05-11 05:32:41 +09: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
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
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
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
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
Andreas Rheinhardt
310cf06a27 avcodec/av1dec: Avoid implicit fallthrough
Fixes a -Wimplicit-fallthrough warning from Clang;
GCC does not warn about this.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-05-05 12:46:00 +02:00
Andreas Rheinhardt
1c522ffdef avcodec/x86/mpegvideoenc{,_template}: Remove remnants of MMX
Reviewed-by: Kieran Kunhya <kieran@kunhya.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-05-04 17:31:05 +02:00
Andreas Rheinhardt
d328a02a9a avcodec/x86/vp6dsp_init: Update obsolete comment
Forgotten in 6cb3ee80b3.

Reviewed-by: Kieran Kunhya <kieran@kunhya.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-05-04 17:31:01 +02:00
Andreas Rheinhardt
564f610cbf avcodec/x86/vc1dsp_loopfilter: Remove MMXEXT funcs overridden by SSSE3
Reviewed-by: Kieran Kunhya <kieran@kunhya.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-05-04 17:28:28 +02:00
Andreas Rheinhardt
6a46ea7da2 avcodec/x86/constants, h263_loopfilter: Move pb_FC to h263_loopfilter
Only used there.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-05-04 16:57:18 +02:00
Thilo Borgmann
aa14727cd5 avcodec/webp: export XMP metadata
Signed-off-by: Ramiro Polla <ramiro.polla@gmail.com>
2026-05-04 12:47:30 +02:00
João Neves
2c71a28bf0 avcodec/hdrdec: fix pixel count decrement in RLE decompress loop
The w variable counts pixels, not bytes. The non-RLE path correctly
uses w-- (one pixel = 4 bytes), but the RLE path uses w -= 4, causing
the loop to terminate after roughly 1/4 of the expected pixels.

The w -= 4 was introduced in 14e99cb472 which moved the decrement
inside the loop to fix an OOB write (clusterfuzz-5423041009549312).
The move was correct, but the decrement value should have been 1 to
match the non-RLE path.

Signed-off-by: João Neves <joaocns0@protonmail.com>
2026-05-03 20:19:51 +00:00
João Neves
daedf4012d avcodec/exr: check rle() return value in rle_uncompress()
rle_uncompress() silently discards the return value of rle(). When the
compressed data is malformed and rle() returns AVERROR_INVALIDDATA,
processing continues on a partially filled buffer. Propagate the error
to the caller, which already handles it at line 1420.

Signed-off-by: João Neves <joaocns0@protonmail.com>
2026-05-03 20:15:54 +00:00
James Almer
1a2c16fe51 avcodec/av1dec: check that primary_ref_frame is within range
Fixes CVE-2026-30997

Fixes: Out-of-Bounds Access
Found-by: Xinghang Lv
Signed-off-by: James Almer <jamrial@gmail.com>
2026-05-03 15:55:21 -03:00
Andreas Rheinhardt
da195b1e84 avcodec/qsvenc: Add av_fallthrough
Reviewed-by: Ramiro Polla <ramiro.polla@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-05-03 18:23:10 +02:00
Andreas Rheinhardt
e1115751dd avcodec/nvenc: Add av_fallthrough
Reviewed-by: Ramiro Polla <ramiro.polla@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-05-03 18:23:07 +02:00
Andreas Rheinhardt
095897060a avcodec/libzvbi-teletextdec: Add av_fallthrough
Reviewed-by: Ramiro Polla <ramiro.polla@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-05-03 18:23:05 +02:00
Andreas Rheinhardt
a9b97d070e avcodec/libxvid: Add av_fallthrough
Reviewed-by: Ramiro Polla <ramiro.polla@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-05-03 18:23:03 +02:00
Andreas Rheinhardt
dc12dd82a1 avcodec/libxavs2: Add av_fallthrough
Reviewed-by: Ramiro Polla <ramiro.polla@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-05-03 18:23:00 +02:00
Andreas Rheinhardt
8881e1a52c avcodec/libvpxenc: Add av_fallthrough
Reviewed-by: Ramiro Polla <ramiro.polla@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-05-03 18:22:58 +02:00
Andreas Rheinhardt
64bea20837 avcodec/libopusenc: Add av_fallthrough
Reviewed-by: Ramiro Polla <ramiro.polla@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-05-03 18:22:56 +02:00
Andreas Rheinhardt
d8b02fdb9f avcodec/libaomenc: Use av_fallthrough to mark fallthrough
Reviewed-by: Ramiro Polla <ramiro.polla@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-05-03 18:22:53 +02:00
Andreas Rheinhardt
3cf225b5f8 avcodec/aac/aacdec: Fix shadowing
Reviewed-by: Ramiro Polla <ramiro.polla@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-05-03 18:22:42 +02:00
Andreas Rheinhardt
d29cbb87c3 avcodec/aac/aacdec: Add av_fallthrough
Reviewed-by: Ramiro Polla <ramiro.polla@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-05-03 18:22:39 +02:00
Andreas Rheinhardt
cf5191fac7 avcodec/hevc/hevcdec: Fix shadowing
Reviewed-by: Ramiro Polla <ramiro.polla@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-05-03 18:22:37 +02:00
Andreas Rheinhardt
0cbf77e843 avcodec/hevc/hevcdec: Add av_fallthrough
Reviewed-by: Ramiro Polla <ramiro.polla@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-05-03 18:22:34 +02:00
Andreas Rheinhardt
e61c940654 avcodec/mpegvideo_enc: Fix shadowing
Reviewed-by: Ramiro Polla <ramiro.polla@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-05-03 18:22:31 +02:00
Andreas Rheinhardt
04ba5e7537 avcodec/mpegvideo_enc: Add av_fallthrough
Reviewed-by: Ramiro Polla <ramiro.polla@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-05-03 18:22:29 +02:00
Andreas Rheinhardt
7b4b658a87 avcodec/mpegvideo_motion: Add av_unreachable, fix fallthrough warnings
Reviewed-by: Ramiro Polla <ramiro.polla@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-05-03 18:22:27 +02:00
Andreas Rheinhardt
4b58570ff7 avcodec/sga: Add av_fallthrough
Reviewed-by: Ramiro Polla <ramiro.polla@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-05-03 18:22:24 +02:00
Andreas Rheinhardt
392ce463a5 avcodec/tiff: Fix shadowing
Reviewed-by: Ramiro Polla <ramiro.polla@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-05-03 18:22:18 +02:00
Andreas Rheinhardt
25b7166fe3 avcodec/tiff: Add av_fallthrough
Reviewed-by: Ramiro Polla <ramiro.polla@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-05-03 18:22:16 +02:00
Andreas Rheinhardt
05a8e89474 avcodec/tta: Fix shadowing
Reviewed-by: Ramiro Polla <ramiro.polla@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-05-03 18:22:13 +02:00
Andreas Rheinhardt
5a7558a0a2 avcodec/tta: Add av_fallthrough
Reviewed-by: Ramiro Polla <ramiro.polla@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-05-03 18:22:11 +02:00
Andreas Rheinhardt
9eeca76cbe avcodec/vdpau_mpeg12: Use av_fallthrough to mark fallthrough
Reviewed-by: Ramiro Polla <ramiro.polla@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-05-03 18:22:07 +02:00