124952 Commits
Author SHA1 Message Date
James Almer 04ae5788df avcodec/itut35: add support for Active Format Description
Needed by h2645_sei.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-06-02 19:50:39 -03:00
James Almer f1929d75a2 avcodec/itut35: add support for AOM film graim
Signed-off-by: James Almer <jamrial@gmail.com>
2026-06-02 19:50:39 -03:00
James Almer c500c786ab avcodec/libaomdec: use the ITU-T T35 parsing helpers
Signed-off-by: James Almer <jamrial@gmail.com>
2026-06-02 19:50:39 -03:00
James Almer e40dd45f0d avcodec/libdav1d: use the ITU-T T35 parsing helpers
Signed-off-by: James Almer <jamrial@gmail.com>
2026-06-02 19:50:39 -03:00
James Almer 19b3d47007 avcodec/av1dec: use the ITU-T T35 parsing helpers
Signed-off-by: James Almer <jamrial@gmail.com>
2026-06-02 19:50:39 -03:00
James Almer 4fcd2349ff avcodec/itut35: add ITU-T T35 parsing helpers
Signed-off-by: James Almer <jamrial@gmail.com>
2026-06-02 19:50:39 -03:00
Omkhar Arasaratnamandmichaelni 711cdae64f avformat/mov: cap HEIF ICC profile copies via c*max_streams to bound CPU and memory
Found-by: Claude (Anthropic). Human-verified and reported by
Omkhar Arasaratnam <omkhar@linkedin.com>.
Signed-off-by: Omkhar Arasaratnam <omkhar@linkedin.com>
2026-06-02 20:55:14 +00:00
Anton Kesyandmichaelni 344a9ce2da avcodec/qsvenc: add unsupported codec level log
Adds missing log of struct mfxInfoMFX member: codec level.

Signed-off-by: Anton Kesy <anton@kesy.de>
2026-06-02 20:51:32 +00:00
zhanghongyuanandmichaelni 02da2c46d2 fftools/opt_common: print encoder-specific capabilities in print_codec()
Add printing of AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE,
AV_CODEC_CAP_ENCODER_FLUSH, and AV_CODEC_CAP_ENCODER_RECON_FRAME
capabilities that were defined but not displayed.
2026-06-02 20:39:56 +00:00
Niklas Haas 8a6027a54f swscale/x86/ops_int: fix write_bits over-write
This writes 4 bytes but in SSE4 mode only produces 2 bytes per vector. We
can avoid over-writing by using the appropriately sized register.

Reproducible by:
  make libswscale/tests/swscale
  libswscale/tests/swscale -dst monob -unscaled 1 -flags unstable -align_src 1 -align_dst 1

Signed-off-by: Niklas Haas <git@haasn.dev>
2026-06-02 15:37:54 +02:00
Niklas Haas 8f38703323 swscale/ops_dispatch: calculate correct slice line count for tail copy
These loops were both assuming that `h` lines need to be copied; but this
varies. First of all, for plane subsampling; but more importantly, when
vertically scaling, the input line count may be substantially lower than the
actual line count.

This fixes an out-of-bounds read/write when vertically upscaling with a tail
buffer.

Verifiable via e.g.:
  make libswscale/tests/swscale
  valgrind -- libswscale/tests/swscale -s 63x63 -src yuv444p -dst rgb24 \
              -flags unstable -align_src 1 -align_dst 1

(As well as the SSIM scores, which drop from ~e-5 to ~e-3 without this fix)

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
2026-06-02 15:36:42 +02:00
Niklas Haas a00db63da7 swscale/tests/swscale: add option to force specific buffer alignment
Useful to make sure the memcpy_in/out paths work as expected.

Signed-off-by: Niklas Haas <git@haasn.dev>
2026-06-02 15:35:00 +02:00
Niklas Haas bb5c461a47 avfilter/vf_libplacebo: setup pl_vulkan_queue.flags on import params
libplacebo versions before v365 passed .flags = 0 when retrieving the queues
from imported Vulkan devices, so we have to error out in the case of a mismatch
to avoid undefined behavior (Vulkan spec).

See-Also: https://code.videolan.org/videolan/libplacebo/-/merge_requests/856
Sponsored-by: nxtedition AB
Signed-off-by: Niklas Haas <git@haasn.dev>
2026-06-02 13:32:44 +02:00
Niklas Haas 9b9d29e09a avfilter/vf_libplacebo: don't unnecessarily set fields to 0 (cosmetic)
Sponsored-by: nxtedition AB
Signed-off-by: Niklas Haas <git@haasn.dev>
2026-06-02 13:32:44 +02:00
Niklas Haas 9fe5758da5 avutil/hwcontext_vulkan: publicly expose queue device creation flags
These are needed for interop with e.g. libplacebo, which needs to know the
correct flags to call vkGetDeviceQueue2.

Signed-off-by: Niklas Haas <git@haasn.dev>
2026-06-02 13:32:43 +02:00
Romain Beauxis 80375ca773 avformat/mpegts: update stream metadata from timed_id3 packets
Set AVSTREAM_EVENT_FLAG_METADATA_UPDATED so applications can detect
mid-stream metadata changes without inspecting packet side data.
2026-06-01 21:53:36 -05:00
Romain Beauxis f6838b8636 tests/fate/demux.mak: add FATE test for timed ID3 packet demuxing in HLS
streams.
2026-06-01 21:53:36 -05:00
Michael Niedermayer 69c9f1158c avcodec/aac/aacdec_usac: avoid signed overflow in decode_tsd
decode_tsd() computes the binomial coefficient c = C(k, p) incrementally.
this commit makes it less overflow prone

Fixes: 515703905/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_DEC_fuzzer-4890954254581760
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-02 00:59:38 +00:00
Michael Niedermayer e711e60827 avcodec/aac/aacdec: reject decoded frame without a valid sample rate
Later code will turn this into AVERROR_BUG

When returning sample_rate == 0 samples is considered a bug, we have no
nice choice but to error out cleanly

Fixes: assertion failure
Fixes: ffmpeg_AV_CODEC_ID_AAC_DEC_fuzzer crash-0a86d46fef2442b222ee34403c21f7f582ffccb0
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-02 00:59:38 +00:00
Michael Niedermayer 620e59bbec avcodec/aac/aacdec: More detailed warning about sample rates
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-02 00:59:38 +00:00
Michael Niedermayer 263374ac7d avcodec/aac/aacdec_usac: reject explicit usacSamplingFrequency of 0
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-02 00:59:38 +00:00
Jun ZhaoandJun Zhao d092269996 lavfi/vf_drawtext: log inferred shaping properties at verbose
Log the script and direction picked by HarfBuzz, plus codepoint and
glyph counts, so the shaper choice can be verified. Differing
codepoint and glyph counts indicate reordering / ligation /
decomposition.

Codepoints are sampled before hb_shape(), which flips the buffer
content type to GLYPHS.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2026-06-02 00:52:03 +00:00
Jun ZhaoandJun Zhao 1f9888beb0 lavfi/vf_drawtext: fix HarfBuzz shaping of Bengali / Indic scripts
shape_text_hb() set HB_SCRIPT_LATIN and called
hb_buffer_guess_segment_properties() on an empty buffer, so the
inference was a no-op. Bengali and other Indic / USE scripts reached
the default OT shaper instead of their script-specific shaper,
leaving the virama visible and consonants disjointed (e.g. স্টারমার
rendered as স্ টারমার).

Add the UTF-8 text first, keep the existing LTR direction used by the
FriBidi visual-order pipeline, then guess segment properties so the
script comes from the actual Unicode contents.

Fixes: https://code.ffmpeg.org/FFmpeg/FFmpeg/issues/23014
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2026-06-02 00:52:03 +00:00
Michael Niedermayer 43f712d917 avformat/iff: check av_get_packet() result in ANIM branch
Fixes: 494958338/clusterfuzz-testcase-minimized-ffmpeg_dem_IFF_fuzzer-6265824670449664
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-01 22:56:47 +00:00
Diego de SouzaandTimo Rothenpieler 93f653f95c configure: enable ffnvcodec, nvenc, nvdec for aarch64 Windows
Adding support to build FFmpeg with HW accelerated decode (nvdec) and
encode (nvenc) on aarch64 Windows, covering both the MinGW (mingw32/
mingw64) and MSVC (win32/win64) toolchains. The dynamically-loaded
NVIDIA codec headers and the CUDA loader are architecture-agnostic, so
the only gate was the target_os check in the aarch64/ppc64 branch.

Signed-off-by: Diego de Souza <ddesouza@nvidia.com>
2026-06-01 17:00:46 +00:00
Romain Beauxis dba111c34d .forgejo: add pull request template with fate-samples section 2026-06-01 10:40:57 -05:00
Romain Beauxis 78fff004f0 .forgejo: add support for ephemeral FATE samples via PR attachments
Developers can attach sample files to a PR and list their target paths
within the fate-suite in a fate-samples block in the PR description:

  ```fate-samples
  vorbis/tos.ogg
  mov/some-new-sample.mov
  ```

A new inject-pr-samples.py script fetches the PR metadata from the
Forgejo API, resolves each listed path to its matching attachment by
filename, and downloads the files into the fate-suite directory before
FATE runs.

The script validates that pr-number is an integer, that paths are
relative, contain no '..', and are at most 3 components deep (matching
the deepest paths in the existing fate-suite).  Attachment URLs are
restricted to the code.ffmpeg.org domain.

The script exports a new_samples=true/false output via $FORGEJO_OUTPUT.
After FATE completes, a final workflow step fails the run if any new
sample was injected, reminding contributors to add their samples to the
official fate-suite before the PR can be merged.

The script can also be used locally:
  SAMPLES=/path/to/fate-suite .forgejo/inject-pr-samples.py <pr-number>
2026-06-01 10:40:57 -05:00
Zhao ZhiliandJames Almer 6f1de91492 fftools/ffmpeg_filter: free input filter channel layout
Fixes the LeakSanitizer failure in fate-dca-xll-coded. It was exposed
by c65c8f1f49.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2026-06-01 14:31:21 +00:00
James Almer 95fe0658d7 avformat/mov: don't abort on unsupported or invalid chnl boxes
They are optional and just define a channel layout, which may also be defined
by the underlying codec.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-06-01 09:53:54 -03:00
James Almer fd1c8fa0e6 avformat/mov_chan: keep the layout untouched on chan/chnl box failure
Needed to keep the process going if some issue was found while parsing these boxes.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-06-01 09:53:54 -03:00
James Almer cd92ef77c9 avformat/mov: add support for version 1 of chnl box
Fixes ticket #11183.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-06-01 09:53:54 -03:00
James Almerandmichaelni bf608f16fd avcodec/cbs_h266_syntax_template: Fix pps_exp_slice_height_in_ctus_minus1 range
Found-by: Claude (Anthropic). Human-verified and reported by Omkhar Arasaratnam <omkhar@linkedin.com>.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-01 03:42:50 +00:00
Michael Niedermayer 97ea5da419 avfilter/vf_scale: split rational multiply
Fixes: integer overflow in SAR
Found-by: jiale yao
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-05-31 21:20:54 +00:00
Kacper Michajłow 59619a1917 tests/fate/hevc: add dovi_split BSF tests 2026-05-31 16:58:23 +02:00
Kacper Michajłow 6026988b75 avcodec/bsf: add dovi_split BSF
Allows splitting interleaved BL+EL HEVC bitstream into separate streams.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2026-05-31 16:58:23 +02:00
Michael Niedermayer 054dffd133 avcodec/bsf/dts2pts: fix binary tree invariant violation on selective dec_poc
Modifying the keys of a sorted structure, be that a tree or other
can lead to changes in the ordering and undefined behavior.
It can also lead to collisions with existing keys.

All these cases need to be handled unless there is a bug elsewhere
that would prevent them.

Fixes: out of array access
Fixes: 504281984/clusterfuzz-testcase-minimized-ffmpeg_BSF_DTS2PTS_fuzzer-6032368162111488

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-31 13:41:57 +00:00
Kacper Michajłow a76eae2765 avfilter/Makefile: fix build with Vulkan and runtime GLSL compilation
Fixes: avfilter/vulkan_shaderc.c:90: undefined reference to `ff_vk_shader_print'
Fixes: #23231

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2026-05-31 13:38:30 +00:00
Lynne 49a77d37be ffv1enc: write f->flt to extradata
The parser has been reading f->flt for combined_version >= 0x40004
since commit c1b330bf24 (avcodec/ffv1: Basic float16 support), but
ff_ffv1_write_extradata() never had a matching put_symbol().
The result was that the parsed f->flt was whatever the next symbol's
worth of rangecoded bits happened to decode to — often 0, but for a
yuv420p16le -level 4 -strict experimental stream produced locally it
parses as 1.  The software decoder doesn't notice because the YUV
pixfmt-selection branches never check f->flt, but anything else that
trusts it gets garbage.

Sponsored-by: Sovereign Tech Fund
2026-05-31 20:04:02 +09:00
Lynne 0678077143 ffv1enc: add RCT coefficient search for Bayer
Sponsored-by: Sovereign Tech Fund
2026-05-31 20:04:02 +09:00
Lynne 4f509c9e43 ffv1dec: implement Bayer pixel format encoding
Sponsored-by: Sovereign Tech Fund
2026-05-31 20:04:02 +09:00
Lynne d62686b50f ffv1enc: implement Bayer pixel format encoding
Sponsored-by: Sovereign Tech Fund
2026-05-31 20:03:57 +09:00
James Almer f778a7e241 avformat: deprecate AVStreamGroupLCEVC
It's been replaced with AVStreamGroupLayeredVideo, which is functionally the
same while generic enough to be shared with other kinds of layered video
implementations.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-05-31 03:43:29 +00:00
Kacper MichajłowandJames Almer b31fdbfde0 avformat/matroskadec: create Dolby Vision stream group
Matroska has no explicit cross-track Dolby Vision reference, so the
pairing is recovered from the dvcC/dvvC config records. Find a single
HEVC track whose record declares a profile 7 enhancement layer
(el_present_flag=1) and a single sibling HEVC BL candidate. If either
side is ambiguous, leave the streams ungrouped.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2026-05-31 03:43:29 +00:00
Kacper MichajłowandJames Almer 29bc8ec8d1 avformat/mpegts: create Dolby Vision stream group
See: https://professionalsupport.dolby.com/s/article/How-to-signal-Dolby-Vision-in-MPEG-2-TS

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2026-05-31 03:43:29 +00:00
Kacper MichajłowandJames Almer 8d89d7c25a avformat/mov: create Dolby Vision stream group
See: https://professionalsupport.dolby.com/s/article/How-to-signal-Dolby-Vision-in-ISOBMFF-format-AKA-mp4-container

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2026-05-31 03:43:29 +00:00
Kacper MichajłowandJames Almer 0a2e0b28d0 avformat/mov: add support for vdep based tref
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2026-05-31 03:43:29 +00:00
Kacper MichajłowandJames Almer d7c7ee4e2e avformat: add AV_STREAM_GROUP_PARAMS_DOLBY_VISION
This uses existing AVStreamGroupLayeredVideo.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2026-05-31 03:43:29 +00:00
Kacper MichajłowandJames Almer 1e3883df9f avformat: rename AVStreamGroupLCEVC to AVStreamGroupLayeredVideo
It will be reused for other similar groups.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2026-05-31 03:43:29 +00:00
Michael Niedermayer 073c44b8bc avfilter/vf_drawtext: Avoid double free in glyph_enu_border_free()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-05-31 03:25:21 +00:00
Michael Niedermayer 77554d85d7 avfilter/vf_drawtext: shape_text_hb() free allocated things on error
Fixes: memleak
Found-by: Fairy

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-05-31 03:25:21 +00:00