Commit Graph

120683 Commits

Author SHA1 Message Date
James Almer 13b161cd24 avcodec/cbs_apv: store derived tile information in a per frame basis
If a single fragment contains more than one frame unit, the tile information stored
in the private context will only correspond to one of them.

Fixes: crash (out of array access)
Fixes: 435489659/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APV_fuzzer-6194885205229568

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 4b39d776c3)
2025-08-12 19:13:06 -03:00
Michael Niedermayer 7c92f740ee avcodec/apv_decode: make apv_format_table consistent with the code and check it
Fixes: writing in a null pointer
Fixes: 435278398/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APV_fuzzer-4566392923029504

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit cfce595572)
2025-08-12 19:13:06 -03:00
Marton Balint 057b94649f swscale/swscale_unscaled: use 8 line alignment for planarCopyWrapper with dithering
Dithering relies on a 8 line dithering table and the code always uses it from
the beginning. So in order to make dithering independent from height of the
slices used we must enforce a 8 line alignment.

Fixes issue #20071.

Signed-off-by: Marton Balint <cus@passwd.hu>
(cherry picked from commit b61e510e75)
2025-08-13 00:02:59 +02:00
Martin Storsjö 26da3d0069 fate: Fix the sub-mcc tests on Windows in eastern time zones
Previously, these tests failed when running on Windows, if the
system is configured with a time zone east of Greenwich, i.e.
with a positive GMT offset.

The muxer converts the creation_date given by the user using
av_parse_time to unix time, as a time_t. The creation_date is
interpreted as a local time, i.e. according to the current time
zone. (This time_t value is then converted back to a broken out
local time form with localtime_r.)

The given reference date/time, "1970-01-01T00:00:00", is the
origin point for unix time, corresponding to time_t zero. However
when interpreted as local time, this doesn't map to exactly zero.
Time zones east of Greenwich reached this time a number of hours
before the point of zero time_t - so the corresponding time_t
value essentially is minus the GMT offset, in seconds.

Windows mktime returns an error, returning (time_t)-1, when given
such a "struct tm", while e.g. glibc mktime happily returns a
negative time_t. av_parse_time doesn't check the return value of
mktime for potential errors.

This is observable with the following test snippet:

    struct tm tm = { 0 };
    tm.tm_year = 70;
    tm.tm_isdst = -1;
    tm.tm_mday = 1;
    tm.tm_hour = 0;
    time_t t = mktime(&tm);
    printf("%d-%02d-%02d %02d:%02d:%02d\n", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec);
    printf("t %d\n", (int)t);

By varying the value of tm_hour and the system time zone, one
can observe that Windows mktime returns -1 for all time_t values
that would have been negative.

This range limit is also documented by Microsoft in detail at
https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/mktime-mktime32-mktime64.

To avoid the issue, pick a different, arbitrary reference time,
which should have a nonnegative time_t for all time zones.

(cherry picked from commit 13139d6d83)
Signed-off-by: Martin Storsjö <martin@martin.st>
2025-08-12 13:45:57 +03:00
Leo Izen a8fdfddedb
avcodec/vp9: fix leaked cbs fragment AVBufferRef
When this function returns, the fragment is never reset, so
current_frag->data_ref is never unref-ed, which ends up leaking it.
We call ff_cbs_fragment_reset to release the reference on its buffer.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2025-08-10 21:05:43 -04:00
Jacob Lifshay 89849ca92a
tests/fate/subtitles: add test for smpte436m_to_eia608 bsf
Signed-off-by: Jacob Lifshay <programmerjake@gmail.com>
2025-08-10 13:13:35 -04:00
Jacob Lifshay 370cff8b33
lavc/bsf/smpte436m_to_eia608: fix memory leak -- forgot to free input av_packet
Signed-off-by: Jacob Lifshay <programmerjake@gmail.com>
2025-08-10 13:13:26 -04:00
Jacob Lifshay 9fd3869212
lavc/bsf/eia608_to_smpte436m: fix memory leak -- forgot to free input av_packet
reported in https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20024#issuecomment-2405

Reported-by: Sean McGovern <gseanmcg@gmail.com>
Signed-off-by: Jacob Lifshay <programmerjake@gmail.com>
2025-08-10 13:13:15 -04:00
Jacob Lifshay 0a167141d0
tests/fate/subtitles: fix mcc test input file paths
they use tests/ref/fate/sub-mcc-remux as input,
so prefix them with $(SRC_PATH) so building works
when not in the source directory.

Fixes: #20183
Reported-by: Sean McGovern <gseanmcg@gmail.com>
Signed-off-by: Jacob Lifshay <programmerjake@gmail.com>
2025-08-10 13:13:07 -04:00
Michael Niedermayer 7eaa0f799a
Bump versions for release/8.0
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-09 17:30:39 +02:00
Michael Niedermayer f4f263aad0
Changelog: Add 8.0 marker
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-09 17:26:13 +02:00
Michael Niedermayer 519d406ce9
doc/APIchanges: update
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-09 17:26:13 +02:00
Michael Niedermayer d6fe3786cd avcodec/jpeg2000dec: Make sure the 4 extra bytes allocated are initialized
Fixes: use of uninitialized memory
Fixes: 429130590/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_DEC_fuzzer-5736930522497024

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-09 14:25:47 +00:00
Vittorio Palmisano 6d9f0b662f libavfilter: add af_whisper codeowner 2025-08-09 15:21:40 +02:00
Lynne a9fb323e88
vulkan: temporarily disable threading for ASIC-based hwaccels
The issue is that a race condition exists between threads locking
frames, which results in cyclic loops and deadlocks.

Compute-based implementations are not affected.

Fixes #20169
2025-08-09 15:07:56 +09:00
Timo Rothenpieler 5621eee672 avformat/tls: switch on peer certificate verification by default 2025-08-09 00:38:17 +00:00
Wu Jianhua abf87f09cb forgejo/CODEOWNERS: add myself to d3d12va
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-08-08 21:51:15 +00:00
Wu Jianhua b8230bfa7f mailmap: add entry for myself
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-08-08 21:51:15 +00:00
Wu Jianhua ac3c1128cf MAINTAINERS: add myself as hwcontext_d3d12va maintainer
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-08-08 21:51:15 +00:00
Vittorio Palmisano 13ce36fef9
libavfilter: Whisper audio filter
It adds a new audio filter for running audio transcriptions with the whisper model.
Documentation and examples are included into the patch.
2025-08-08 21:59:56 +02:00
Wu Jianhua 2eaf044e2f CODEOWNERS: Add myself for VVC
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-08-08 17:51:52 +00:00
Nuo Mi 7773d734e5 CODEOWNERS: Add myself for VVC
Signed-off-by: Nuo Mi <nuomi2021@gmail.com>
2025-08-08 17:51:52 +00:00
Wu Jianhua dff08a3d2a fate/vvc: add vvc-conformance-FIELD_A_4
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-08-08 16:55:12 +00:00
Wu Jianhua 6d391cb2da fate/vvc: add vvc-conformance-ACT_A_3
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-08-08 16:55:12 +00:00
Wu Jianhua 6e100b7963 fate/vvc: add vvc-conformance-10b422_L_5
This commit added 10b422_L_5 for testing palette mode.

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-08-08 16:55:12 +00:00
Wu Jianhua de15422064 avcodec/vvc/dec: fix typo and also output log when the checksum is correct
It's helpful for developers and the same as the hevcdec.

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-08-08 16:55:12 +00:00
Wu Jianhua 8c9a2f40ad avcodec/h274: fix hash verification on BE
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-08-08 16:55:12 +00:00
Wu Jianhua 77b9b9420b avcodec/vvc/ctu: should use the width and height of the start component
This commit fixed decoding the DUAL_TREE_CHROMA palette coding unit

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
2025-08-08 16:55:12 +00:00
Muhammad Faiz 35ea458354 avfilter/avf_showcqt: fix unbounded index when copying to fft_data
When timeclamp and/or fps are low, j can be negative.

Fix Ticket11640
2025-08-08 18:47:44 +02:00
Timo Rothenpieler aac1cddbeb forgejo/CODEOWNER: forgejo uses regex to match paths 2025-08-08 18:14:58 +02:00
James Almer 1cde49ed82 avutil/hwcontext_vulkan: use uint64_t specifier in an av_log() call
Signed-off-by: James Almer <jamrial@gmail.com>
2025-08-08 15:24:57 +00:00
James Almer 88bec585bc avcodec/vulkan_encode_av1: use size_t specifier in an av_log() call
Signed-off-by: James Almer <jamrial@gmail.com>
2025-08-08 15:24:57 +00:00
James Almer 9212963093 avcodec/vulkan_encode_av1: remove unused variables
Signed-off-by: James Almer <jamrial@gmail.com>
2025-08-08 15:24:57 +00:00
Lynne d132b63dd9 vulkan_encode_av1: properly give an FPS value for ff_av1_guess_level 2025-08-08 15:07:33 +00:00
Lynne 6f97c9384b configure: enable Vulkan VP9 decoding and AV1 encoding if the headers support it 2025-08-08 15:07:33 +00:00
Lynne eb9e000584 vulkan_decode: add ifdefs around VP9 definitions and privatize profile struct
The struct is not referenced anywhere else.
2025-08-08 15:07:33 +00:00
Benjamin Cheng f7a5128109 vulkan_av1: Fix frame threading
Basically do the same thing that was done for VP9, and remove the
vestigial frame_id_alloc_mask in the context.
2025-08-08 14:45:58 +00:00
Benjamin Cheng 4042609dcf vulkan_vp9: Fix frame threading
The original cleanup of frame_id_alloc_mask was done in free_frame_priv
which may be called after the start_frame for the next few frames,
causing the frame_id slots to be exhausted. Instead, decide the in-use
frame_id slots by checking the frame_id present in the DPB as we need it.
2025-08-08 14:45:58 +00:00
David Rosca 814dd634e0 lavc/vaapi_encode_av1: Fix ref_order_hint value for second slot
We always use two slots, even when only one L0 reference is supported
by the driver. However we still need to set the correct value for the
ref_order_hint of the second slot.

Fixes regression from bf9f921ef7 ("avcodec/hw_base_encode: restrict size of next_prev")
2025-08-08 13:14:07 +00:00
nyanmisaka 523134587a lavu/hwcontext_vaapi: drop a redundant check
vaapi_get_image_format() will be called in vaapi_map_frame().

So it's a double check, drop it to avoid redundancy.

Signed-off-by: nyanmisaka <nst799610810@gmail.com>
2025-08-08 12:53:39 +00:00
nyanmisaka eb9070aba4 lavu/hwcontext_vaapi: fix a race mapping to allow CSC to YUV420P
There's a race condition for YUV420P when mapping from pix_fmt
to VA fourcc, both I420 and YV12 could be found by pix_fmt.

Currently, vaapi_get_image_format() iterates over the query results
of pix_fmt and returns the first matching result in the order
declared in the driver. This may result in an incorrect image_format.

Now use fourcc to find the image_format.

Fixes:
ffmpeg -hwaccel vaapi -hwaccel_output_format vaapi -i INPUT \
-vf scale_vaapi=format=yuv420p,hwmap,format=yuv420p \
-vframes 1 -f rawvideo -y yuv420p.yuv

Signed-off-by: nyanmisaka <nst799610810@gmail.com>
2025-08-08 12:53:39 +00:00
Michael Niedermayer d643a5ba08
avcodec/aac/aacdec_usac: Limit sfo from noise offset to be above -200
Fixes: out of array read
Fixes: 397731127/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_LATM_fuzzer-5577772965101568

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-08 14:21:50 +02:00
Michael Niedermayer 01a1b99fc2
avcodec/aacsbr_template: Check ilb
Fixes: index 50 out of bounds for type 'INTFLOAT [40][2]'
Fixes: 401661737/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_LATM_fuzzer-4866055713652736

Someone knowing AAC well should review this, there is likely a nicer fix

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-08 14:21:36 +02:00
David Rosca 069daca9e0 vulkan_encode_av1: Fix uninitialized return value in write_extra_headers 2025-08-08 12:18:24 +00:00
David Rosca db6fd82651 vulkan_encode_av1: Fix setting QP
Use the "qp" param instead of "global_quality" to match H264/5.
2025-08-08 12:00:16 +00:00
Niklas Haas 6862ec704a avfilter/vf_libplaceb: use TS2T() macro 2025-08-08 11:29:27 +00:00
Niklas Haas d69ccbfc18 avfilter/vf_libplacebo: use the first visible input for metadata
Instead of undconditionally using the first input. This covers the case of
one layer fully obscuring another layer, in which case that should become
the new "base" layer.
2025-08-08 11:29:27 +00:00
Niklas Haas 62893fb94e avfilter/vf_libplacebo: flush render cache when input is invisible
This prevents leaking stale metadata from previous frames, for example if
an overlay temporarily obscures this input and then un-obscures it again. It
is worth pointing out that this does change the semantics subtly, because of
the smoothing period on detected HDR metadata, but I argue that the new
behavior is an improvement, as it will avoid leaking past metadata that is
definitely no longer relevant after an image is unobscured.
2025-08-08 11:29:27 +00:00
Niklas Haas 3091bca3ed avfilter/vf_libplacebo: skip rendering fully invisible planes
Sometimes, one input fully obscures another. In this case, we can skip
actually rendering any input below the obscuring one.

The reason I don't simply start the main render loop at `idx_start` will
become apparent in the following commit.

We can't use pl_frame_is_cropped() on this dummy frame, but we need to
determine the reference frame before we can map the real output, so to
resolve this conflict, we just reimplement the crop detection logic using
the output link dimensions.
2025-08-08 11:29:27 +00:00
Niklas Haas 6627c8ea4b avfilter/vf_libplacebo: skip empty inputs
It is possible for pl_queue_update() to return PL_QUEUE_OK, but to generate
an empty frame mix. This happens if the first frame of that input is in the
future.

In this case, we should skip an input as not active, similar to inputs that
have already reached EOF.
2025-08-08 11:29:27 +00:00