12919 Commits
Author SHA1 Message Date
Kyle Swanson 58584087cf avfilter/vf_libvmaf: pass frame colorimetry to libvmaf
Signed-off-by: Kyle Swanson <kswanson@netflix.com>
2026-10-27 20:01:52 +00:00
Jake Fineman 15423fa745 avfilter/dnn_backend_openvino: fix partial shape leak in get_output_ov()
With input_resizable enabled, get_output_ov() created partial_shape with
ov_partial_shape_create() and then passed the same variable to
ov_shape_to_partial_shape(), which allocates a new dims array and
overwrites the struct. The first allocation was never freed, so every
call leaked it, on the success path and on the two error returns in
between. The dims it was built from were never used.

Drop the ov_partial_shape_create() call and the dims array; the partial
shape is built from the model's input shape by ov_shape_to_partial_shape()
and freed after ov_model_reshape_single_input() as before.

The leak was introduced with the OpenVINO API 2.0 support in e79bd1f1b1.

Signed-off-by: Jake Fineman <jake@wave.online>
2026-10-27 13:37:42 +00:00
Martin Mirchev a7241b6a77 avfilter/vf_vignette: keep the backward gain finite
In backward mode the gain is 1 / factor, but the factor is 0 for pixels
farther than dmax from the center (possible with x0/y0 or aspect), so
the gain is inf. inf * sample, or inf * 0 = NaN, is then converted to
int, which is undefined behaviour; on x86 these pixels come out black
instead of saturated.

For angles close to PI/2, the factor can also become small enough that
a finite backward gain produces sample values outside the range of int
before av_clip_uint8() is called. Bound the gain at 256 to keep these
conversions in range while preserving the saturated 8-bit output.

Signed-off-by: Martin Mirchev <mmirchev@comp.nus.edu.sg>
2026-10-26 22:36:19 +00:00
Michael Niedermayer a3f1b1e87c avutil/framepool: provide a single copy for static builds
Both libavfilter and libswscale currently put framepool.o in their regular
OBJS, defining the same four ff_frame_pool_* symbols. Loading both static
archives in full therefore fails with multiple definitions.

Move the implementation and internal header to libavutil. Include the
object in its STLIBOBJS when either consumer is enabled, and use SHLIBOBJS
for the private copies in libavfilter and libswscale. This preserves
independent builds and shared-library symbol visibility without adding
an inter-library dependency or exposing a new public API.

Verified whole-archive links with both consumers, and with each consumer
configured independently. Shared builds pass fate-filter-rgbtestsrc-gbrp12
and fate-filter-rgbtestsrc-gbrap12; static and shared video scaling and
audio volume smoke tests produce identical frame checksums. Also checked
static consumers linked against shared dependencies.

Fixes: 6c89a30ecd
Fixes: #25419
Assisted-by: Fairy
2026-10-26 16:53:24 +00:00
James Almer ceb466cbcd avfilter/avfiltergraph: call print_filter_formats with TRACE log level
It's way too noisy for debug level.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-10-26 13:14:21 +00:00
Rodrigo Camacho 3719f257cf avfilter/scene_sad: R-V V scene_sad
Benchmarking results:

checkasm:
 - CPU: SpacemiT, vendor arch 0x58000001, imp 0x1000000049772200
 - CPU: VLEN = 256 bits
 - Timing source: gettime
 - Bench duration: 1000 µs per function (1000000 nsecs)
 - Random seed: 4056509538
RV_zve64x:
 - scene_sad.scene_sad8  [OK]
 - scene_sad.scene_sad10 [OK]
 - scene_sad.scene_sad12 [OK]
 - scene_sad.scene_sad14 [OK]
 - scene_sad.scene_sad15 [OK]
 - scene_sad.scene_sad16 [OK]
checkasm: all 6 tests passed
Benchmark results:
  name                    nsecs (vs ref)
  scene_sad8_c:        331870.0
  scene_sad8_rvv_i64:   27121.5 (12.23x)
  scene_sad10_c:       335723.6
  scene_sad10_rvv_i64:  52943.8 ( 6.33x)
  scene_sad12_c:       335534.9
  scene_sad12_rvv_i64:  52930.4 ( 6.33x)
  scene_sad14_c:       335625.7
  scene_sad14_rvv_i64:  52728.6 ( 6.36x)
  scene_sad15_c:       335521.3
  scene_sad15_rvv_i64:  52937.0 ( 6.33x)
  scene_sad16_c:       335549.9
  scene_sad16_rvv_i64:  52768.3 ( 6.35x)

Signed-off-by: Rodrigo Camacho <rodrigompcamacho@gmail.com>
2026-10-24 23:45:47 +00:00
Timo Rothenpieler d205b2fd0f avfilter/vsrc_gfxcapture: use AV_NOPTS_VALUE as default for pts fields 2026-10-24 20:55:29 +00:00
Rafael Henrique Gonçalves de OliveiraandTimo Rothenpieler 9627f97678 avfilter/vsrc_gfxcapture: add dup_frames option
Windows Graphics Capture only delivers a frame when the captured content
changes, so a static source makes gfxcapture output nothing at all. An
fps filter after it cannot help, since it has no later frame to
duplicate up to, and anything muxed alongside stalls as well.

Add a dup_frames option, like ddagrab has. When no new frame arrived
within one 1/max_framerate interval, output a new reference to the last
frame, or a black frame before the source delivered its first one.
Repeats are stamped with their deadline in the QPC clock, the same clock
as SystemRelativeTime, and the next deadline counts from the previous
one, so timer overshoot shows up neither in the timestamps nor in the
rate. A captured frame timestamped at or before the last output is
bumped to keep timestamps increasing.

The new option is on by default, since the current behaviour is arguably
surprising and clashes with how a lot of the filter chain and the
fftools work.

Signed-off-by: Rafael Henrique Gonçalves de Oliveira <rafaelh9six@gmail.com>
Co-authored-by: Timo Rothenpieler <timo@rothenpieler.org>
2026-10-24 20:55:29 +00:00
Rafael Henrique Gonçalves de Oliveira 532486e0a5 avfilter/vsrc_gfxcapture: use fresh callback state for each WGC thread call
run_on_wgc_thread() reused one callback state for every call and reset
its cancel flag each time. A callback that timed out while still queued
could then run after the next call's reset, through references to the
earlier caller's stack. Each call now gets its own state, which the
queued callback keeps alive.

Signed-off-by: Rafael Henrique Gonçalves de Oliveira <rafaelh9six@gmail.com>
2026-10-24 20:55:29 +00:00
Rafael Henrique Gonçalves de Oliveira a8e795f525 avfilter/vsrc_gfxcapture: lock the device context around ExecuteCommandList
The immediate context is shared with the rest of the hw device's users,
and AVD3D11VADeviceContext's lock is what serializes calls on it.

Signed-off-by: Rafael Henrique Gonçalves de Oliveira <rafaelh9six@gmail.com>
2026-10-24 20:55:29 +00:00
Michael Niedermayer 95d27d9f05 avfilter/vf_fieldmatch: use the chroma subsampling when marking combed chroma
Fixes: out of array write
Fixes: z4YbWg6eX0Hr

Found during triage/review of the security report 0fHkOzVCAhre

Out of array write Replicated through UnModified FFmpeg with ASAN

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-10-24 20:19:14 +00:00
Michael Niedermayer cf725b9352 avfilter/vf_fieldmatch: stop compare_fields() at the last complete field line
Fixes: out of array read
Fixes: 8Vo2w4S3WNCd

Found during triage/review of the security report 0fHkOzVCAhre

Out of array read Replicated through UnModified FFmpeg with ASAN

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-10-24 20:19:14 +00:00
Michael Niedermayer 77a09f0741 avfilter/vf_fieldmatch: reject heights too small for the comb detection
Fixes: out of array read
Fixes: 0fHkOzVCAhre
Fixes: swarm-OOB-read-in-combed-score-when-height-3-df4610

Found-by: zhang xingxing <2388969553@qq.com>
A height check in config_input() was suggested in the report.

Out of array read Replicated through UnModified FFmpeg with ASAN

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-10-24 20:19:14 +00:00
James Almer 5f0a7701c1 Bump minor after branching release/9.1
Signed-off-by: James Almer <jamrial@gmail.com>
2026-10-24 17:05:20 -03:00
James Almer aecf409c18 Bump minor version for release/9.1
Signed-off-by: James Almer <jamrial@gmail.com>
2026-10-24 17:05:20 -03:00
Michael Niedermayer abb54ce406 Bump minor after branching release/9.1
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-10-23 06:44:03 +02:00
Michael Niedermayer 66143d6aaa Bump minor version for release/9.1
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-10-23 06:44:03 +02:00
Kyle Swanson 179d083493 avfilter/vf_libvmaf: use vmaf_picture_wrap() if available
Signed-off-by: Kyle Swanson <kswanson@netflix.com>
2026-10-22 20:55:23 +00:00
Stefan Singer 9295e3ef65 avfilter/whisper: include detected language in JSON output
The whisper filter exposes segment timestamps and text in JSON but omits the language selected by whisper.cpp. Clients consuming multilingual transcripts cannot distinguish the language of each transcription chunk without detecting it again.

Read whisper_full_lang_id() after each successful transcription and include its language code in JSON segments when available. This leaves the configured language and audio-frame metadata unchanged. Document that the code applies to the whole chunk, not to individual segments.

Tested with a minimal --enable-whisper build, make fate (without external SAMPLES), and a local WAV transcription using a multilingual tiny model.

Signed-off-by: Stefan Singer <stefan.singer@quartr.se>
2026-10-22 04:31:40 +00:00
Michael Niedermayer 5fd305b8f4 avfilter/firequalizer: avoid overflow selecting RDFT length
The nsamples_max doubling can overflow int for an accepted delay, causing an undersized RDFT and an out-of-bounds write during kernel generation. Compare in int64_t so excessive delays take the existing error path.

Add a FATE check for the reported delay.

Fixes: #24344
Reported-by: yijan4845
Assisted-by: Fairy
2026-10-22 01:26:03 +00:00
Michael Niedermayer 8493e8bad3 avfilter/vf_hwupload_cuda: give the preceding filter transfer buffers to write into
The frames a filter in front of hwupload_cuda produces are allocated
with av_hwframe_get_transfer_buffer(), so that the upload reads from
memory the device transfers directly from.

Assisted-by: Claude
2026-10-21 19:32:23 +00:00
Michael Niedermayer 7e99475ce9 avfilter/video: factor set_link_props() out of ff_default_get_video_buffer2()
Assisted-by: Claude
2026-10-21 19:32:23 +00:00
Michael Niedermayer e2798d5cad avfilter/dnn_backend_tf: validate inference request before dereference
Check the request before reading its fields and use a context-free log for
the NULL case. This makes the documented EINVAL return reachable.

Assisted-by: Fairy
2026-10-21 11:39:12 +00:00
Michael Niedermayer 3edc8c2e1e avfilter/avfiltergraph: do not copy the channel layouts compared in swap_channel_layouts_on_filter()
Fixes: ZcCsKQC5oFuJ
Fixes: memleak
Memory leak Replicated through UnModified FFmpeg with LSan
Found during triage of the review of https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24577
2026-10-20 20:41:50 +00:00
Michael Niedermayer ca9aa7edd6 avfilter/vf_hqdn3d: forget the configured width when the buffers are freed
Fixes: WDZyf7w7BNU1
Fixes: NULL pointer dereference
NULL dereference after a failed allocation Replicated through API with ASAN
Found during the review of https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24765
2026-10-20 20:41:50 +00:00
Michael Niedermayer f90f210d31 avfilter/f_perms: free the input frame when it cannot be made writable or cloned
Fixes: 1MIkYBeZ4sTX
Fixes: memleak
Memory leak Replicated through Modified FFmpeg with LSan
Found during triage of the review of https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24765
2026-10-20 20:41:50 +00:00
Michael Niedermayer 88cd68c8fd avfilter: make a frame whose format differs from the link writable with av_frame_make_writable()
Fixes: A3O7F4s10WXJ
Fixes: EINVAL on a format change
EINVAL on a format change Replicated through UnModified FFmpeg with a plain output diff
Found during the review of https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24765
2026-10-20 20:41:50 +00:00
Michael Niedermayer f0eedb48b6 avfilter/af_alimiter: do not mark attack as a runtime option
Fixes: MxIcMabVhhFR
Fixes: command without effect
Command without effect Replicated through UnModified FFmpeg with a plain output diff
Found during triage of the review of https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24672
2026-10-20 20:41:50 +00:00
Michael Niedermayer 00ad4cba89 avfilter/af_alimiter: convert the attack, release and asc_level options where they are used
Fixes: fZnlZKlJmMn0
Fixes: wrong release time and asc level after a command
Wrong release time and asc level after a command Replicated through UnModified FFmpeg with a plain output diff
Found during the review of https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24672
2026-10-20 20:41:50 +00:00
Michael Niedermayer a28c9cdc02 avfilter/vf_cropdetect: scan the edge map inside the motion bounding box
The fate-filter-metadata-cropdetect1/2 references change as the scans
now stop at the edge free lines next to the box.

Fixes: s7zfKOCXo4MJ
Fixes: wrong crop area with mode=mvedges
Wrong crop area with mode=mvedges Replicated through UnModified FFmpeg with a plain output diff
Found during triage of the security report VoiiaDYyhdfz
Found again by the review of https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24623
2026-10-20 20:41:50 +00:00
Michael Niedermayer dd01289032 avfilter/dnn_backend_torch: wait only for the inference requests that were created
Fixes: nC3u8khGyx61
Fixes: hang on teardown
Hang on teardown Replicated through UnModified FFmpeg with gdb
Found during triage of the review of https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24617
2026-10-20 20:41:50 +00:00
Michael Niedermayer e3692c0895 avfilter/dnn_backend_tf: wait only for the inference requests that were created
Fixes: nC3u8khGyx61
Fixes: hang on teardown
Hang on teardown Replicated through UnModified FFmpeg with gdb
Found during triage of the review of https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24617
2026-10-20 20:41:50 +00:00
Michael Niedermayer 25e4cde609 avfilter/dnn_backend_openvino: free the frames when execution fails before the task is queued
This is not a security issue.

Fixes: 6HSeekmc6mV7
Fixes: 8YwigyLd85Gn
Fixes: swarm-Memory-leak-of-input-output-frames-on-ff_dnn_execute_model-failure-3a5cbe
Fixes: memleak
Memory leak Replicated through UnModified FFmpeg with LSan

Found-by: zhang xingxing <2388969553@qq.com>
2026-10-20 20:41:50 +00:00
Michael Niedermayer 91be1619e2 avfilter/dnn_backend_openvino: do not dereference output_names when the ports are looked up by index
Fixes: O0Cm42dvrP4l
Fixes: NULL pointer dereference
NULL pointer dereference Replicated through UnModified FFmpeg with UBSAN and gdb
Found during the review of https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24617
2026-10-20 20:41:50 +00:00
Michael Niedermayer 33ac0ca199 avfilter/dnn_backend_openvino: wait only for the inference requests that were created
Fixes: nC3u8khGyx61
Fixes: hang on teardown
Hang on teardown Replicated through UnModified FFmpeg with gdb
Hang on teardown Replicated through UnModified FFmpeg with gdb, a crafted 10240x10240 PNG, input_resizable=1 and vm.overcommit_memory=2
Found during the review of https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24617
2026-10-20 20:41:50 +00:00
Michael Niedermayer 43f200e077 avfilter/dnn_backend_openvino: return an error when creating an inference request fails
Fixes: cE2BMN6svM0X
Fixes: success reported after a failure
Success reported after a failure Replicated through UnModified FFmpeg with LSan
Found during the review of https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24617
2026-10-20 20:41:50 +00:00
Michael Niedermayer 2c31cf561f avfilter/dnn_backend_openvino: do not free the input layouts twice
Fixes: o7gnt6oof6Qd
Fixes: use after free
Fixes: double free
Heap use after free after an allocation failure Replicated through UnModified FFmpeg with ASAN, the allocation failure injected through an LD_PRELOAD shim
Double free Replicated through UnModified FFmpeg with gdb, a crafted 8192x8192 PNG, input_resizable=1 and vm.overcommit_memory=2
Found during triage of the review of https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24617
2026-10-20 20:41:50 +00:00
Michael Niedermayer a8ba973e1a avfilter/vf_libopencv: stop at the end of the shape file without stepping past it
Fixes: XPtsDsDMo2NW
Fixes: pointer formed two past the mapping
Pointer formed two past the mapping Replicated through Modified FFmpeg with an assertion
Found during the review of https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24753
2026-10-20 20:41:50 +00:00
Michael Niedermayer f3b95e698d avfilter/vf_lcevc: free the input frame when sending it to the decoder fails
Fixes: qchet66gqCBs
Fixes: memleak
Memleak Replicated through UnModified FFmpeg with LSan, LCEVC_SendDecoderBase() failing through an LD_PRELOAD shim
Found during triage of the review of https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24765
2026-10-20 20:41:50 +00:00
Michael Niedermayer d21ed89463 avfilter/vf_showinfo: do not checksum hardware frames
Fixes: lJDYwsOtMQXY
Fixes: EINVAL on every hardware frame
EINVAL on every hardware frame Replicated through UnModified FFmpeg with plain output
Found during the review of https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24765
2026-10-20 20:41:50 +00:00
Michael Niedermayer 240475d3dd avfilter/vf_showinfo: free the frame when av_image_get_linesize() fails
Fixes: lJDYwsOtMQXY
Fixes: memleak
Memleak Replicated through UnModified FFmpeg with LSan
Found during the review of https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24765
2026-10-20 20:41:50 +00:00
zhang xingxing ddb610f9fe avfilter/qrencode: free the rendered width expressions
This is not a security issue.

Fixes: oFKoC1YimRPu
Fixes: swarm-Memory-leak-qr--text-and-pexpr-fields-not-freed-in-uninit-5cc723

Found-by: zhang xingxing <2388969553@qq.com>

Memory leak Replicated through UnModified FFmpeg with LSAN

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-10-20 11:36:57 +00:00
Michael Niedermayer 341553de8a avfilter/dnn_backend_openvino: do not free the model when updating it fails
Fixes: double free
Fixes: QIOnvFKEz80N
Regression since: 22652b576c
Found during triage of the review of https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24617
Double free Replicated through UnModified FFmpeg with ASAN
2026-10-20 02:25:09 +00:00
Michael Niedermayer 21c4aad654 avfilter/dnn_backend_openvino: set the number of outputs together with the output ports
Fixes: NULL pointer dereference
Fixes: gJMHsT6GErl5
Regression since: 22652b576c
Found during triage of the review of https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24617
NULL pointer dereference Replicated through UnModified FFmpeg with ASAN
2026-10-20 02:25:09 +00:00
Michael Niedermayer 94e1680dbf avfilter/vf_drawbox: check the expression results before converting them to int
Fixes: out of range float to int conversion
Fixes: signed integer overflow
Fixes: 4jtp2TTOoEsQ
Found during triage of the review of https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24765
Out of range float to int conversion Replicated through UnModified FFmpeg with UBSAN
Signed integer overflow Replicated through UnModified FFmpeg with UBSAN
2026-10-20 02:25:09 +00:00
Michael Niedermayer 86b257b4da avfilter/motion_estimation: use separate linesizes for the current and reference frame
Fixes: out of array read
Fixes: Au41rSBM5kGS
Found during triage of the review of https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24765
Out of array read Replicated through UnModified FFmpeg with ASAN
2026-10-20 02:25:09 +00:00
Michael Niedermayer 6a025044c7 avfilter/vf_photosensitivity: blend only the visible part of the lines
Fixes: out of array read
Fixes: Au41rSBM5kGS
Found during triage of the review of https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24765
Out of array read Replicated through UnModified FFmpeg with ASAN
2026-10-20 02:25:09 +00:00
Michael Niedermayer 27f61c0ff5 avfilter/vf_idet: use the linesize of the previous and next frame
Fixes: out of array read
Fixes: Au41rSBM5kGS
Found during triage of the review of https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24765
Out of array read Replicated through UnModified FFmpeg with ASAN
2026-10-20 02:25:09 +00:00
Michael Niedermayer 5cd8e58b94 avfilter/vf_deshake: use the linesize of the reference frame
Fixes: out of array read
Fixes: Au41rSBM5kGS
Found during triage of the review of https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24765
Out of array read Replicated through UnModified FFmpeg with ASAN
2026-10-20 02:25:09 +00:00
Michael Niedermayer f703292c42 avfilter/vf_libopencv: reject shapes too big for OpenCV
Fixes: out of array write
Fixes: EVA3Y4e693ul
Found during the review of https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24753
Out of array write Replicated through UnModified FFmpeg with ASAN
2026-10-20 02:25:09 +00:00