1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-11-23 21:54:53 +02:00
Commit Graph

120891 Commits

Author SHA1 Message Date
Michael Niedermayer
2a22972db3 avcodec/utvideodec: Clear plane_start array
in pack mode the array is passed into decode_plane() without being initialized or used

Fixes: use of uninitialized memory
Fixes: 438780119/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_UTVIDEO_DEC_fuzzer-5464037027807232

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-15 18:00:11 +02:00
Oliver Chang
c9e93df4ee avcodec/prores_raw: Fix heap buffer overflow
When dimensions differ from context, those were updated using
ff_set_dimensions, however this overwrote the aligned coded_width and
coded_height that were set before, leading to a buffer overflow when
writing the frame data.

Fixes: OssFuzz 438771336
Fixes: Heap-buffer-overflow

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Marvin Scholz <epirat07@gmail.com>
Reviewed-by: Marvin Scholz <epirat07@gmail.com>
2025-08-15 15:06:58 +00:00
David Rosca
ac5303a5b9 hw_base_encode: Support refs option to limit number of references
Set default value to 0 to keep the old behavior of using maximum number
of references.
2025-08-15 13:55:51 +00:00
Michael Niedermayer
7d606ef0cc .forgejo/CODEOWNERS: remove reference to secret apparently uncommited code
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-15 00:51:23 +02:00
Kacper Michajłow
47c6af7d29 avutil/avassert: always implement av_assume with av_unreachable
One of the design goals of this macro is the ability to support static
inline predicate functions. Which is emitting warning in clang that a
function may have side-effects and the condition will be ignored. MSVC
doesn't emit warning, but also ignore predicate in such cases.

Instead of using assume builtins, implement it using unreachable. Which
solves this case for MSVC and Clang.

This reverts ea56fe60ac, but also extends
it to MSVC, which is affected in the similar way.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-14 19:42:13 +00:00
Kacper Michajłow
3ab9eebba7 avcodec/Makefile: add missing dependency for prores raw decoder (again)
proresdata.o is also needed, missed in a9e7b5aa07

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-14 18:06:49 +02:00
Pavel Koshevoy
a7c8c4ee1c lavc/mfenc: set output packet duration
Signed-off-by: James Almer <jamrial@gmail.com>
2025-08-14 11:13:09 -03:00
Leo Izen
1532caaab0 RELEASE: update to 8.0 2025-08-14 08:42:29 -04:00
devjeonghwan
243b392d83 avformat/apngdec: allow other chunks between fcTL and fdAT/IDAT 2025-08-14 08:05:21 -04:00
Kacper Michajłow
a9e7b5aa07 avcodec/Makefile: add missing dependency for prores raw decoder
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-14 04:43:16 +02:00
Michael Niedermayer
cdbb5f1b93 fftools/ffmpeg_mux_init: Use 64bit for score computation in map_auto_video()
Fixes: signed integer overflow: 10 * 1952737655 cannot be represented in type 'int'
Fixes: PoC_avi_demux

Found-by: 2ourc3 (Salim LARGO)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-14 00:36:29 +00:00
Kacper Michajłow
589b934417 compat/getopt: constify opts
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-14 00:08:10 +00:00
Kacper Michajłow
d3375101fe avcodec/vp8: remove set, but never used variable
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-14 00:08:10 +00:00
Kacper Michajłow
218ef98ea3 avcodec/j2kenc: remove set, but never used variable
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-14 00:08:10 +00:00
Kacper Michajłow
c5093f59c8 avcodec/x86/vc1dsp: add missing header for HAVE_6REGS
x86/vc1dsp_init.c already includes asm.h before, so this is mostly
cosmetic change and only to clean checkheaders warning.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-14 00:08:10 +00:00
softworkz
1ad97b82f3 fftools/resources: Update .gitignore
Signed-off-by: softworkz <softworkz@hotmail.com>
2025-08-13 17:39:49 +00:00
softworkz
a125f5db03 ffbuild/commonmak: Consolidate pattern rules for compression
This commit simplifies and consolidates all the rules around
ptx and resource file compression.

Signed-off-by: softworkz <softworkz@hotmail.com>
2025-08-13 17:39:49 +00:00
softworkz
f52d9dd869 fftools/resources: Fix double-build by disabling .d file generation
Signed-off-by: softworkz <softworkz@hotmail.com>
2025-08-13 17:39:49 +00:00
James Almer
230fafe68a tests/fate/cbs: add a test for gray apv
Signed-off-by: James Almer <jamrial@gmail.com>
2025-08-13 11:42:50 -03:00
James Almer
64b6cfe7fb tests/fate/cbs: move redundant_pps tests to the proper location
cbs.mak is meant to contain tests strictly for the CBS framework, not for any
bsf that happens to use it under the hood.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-08-13 11:36:22 -03:00
Kacper Michajłow
8eca3fa619 configure: use proper Windows-style static library naming
On Windows, static libraries are typically named with a .lib extension.
An exception to this is MinGW targets, which are treated as a distinct
target-os.

Using Windows-style naming allows `clang` to be used as the linker
driver, instead of invoking link or lld-link directly. The latter
approach requires manually specifying standard libraries when compiling
with `clang` rather than `clang-cl`, and manually specifying standard
libraries may be error-prone or incomplete.

Using Windows-style naming allows Clang to be used as the linker driver,
instead of invoking link or lld-link directly. The latter approach
requires manually specifying standard libraries, which may be
error-prone or incomplete.

This change also improves support for LTO and sanitizer builds, where
it's significantly easier to let the compiler driver manage the
necessary linker flags.

It fixes issues where Clang is asked to link `-lavcodec`, which gets
passed to the linker as avcodec.lib, resulting in an error like:
lld-link: error: could not open 'avcodec.lib': no such file or directory
This happens because `libavcodec.a` was unexpectedly generated, not
`avcodec.lib` expected by tooling.

Additionally, using `clang` (not `clang-cl`) is simplified, as it does
not use autolinking like MSVC/clang-cl does. Now `--ld=clang` can be
used to add all the required libraries. Previously, building with
`clang` was only possible by using `--ld=lld-link` and manually
specifying system dependencies in `extra-ldflags`.

Note that those changes doesn't affect mingw build. MSVC builds will
produce .lib static libraries now, but the linking process itself is not
affected, because filenames are passed directly.

To summarize in Windows non-mingw builds:
Static builds now produce `lib/avcodec.lib` instead of `lib/libavcodec.a`.
Shared builds remain unchanged, producing `bin/avcodec.lib` together with
`bin/avcodec-62.dll`.

This also removes setting LD_LIB from Win32/64 target as there is one
type of .lib in practice. We cannot build both shared and static at the
same time as noted by the next line.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-13 13:17:53 +00:00
Jiasheng Jiang
b8d5f65b9e libavfilter/dnn/dnn_backend_tf: Remove redundant av_freep() to avoid double free
Remove redundant av_freep() to avoid double free since task will be freed in dnn_free_model_tf() after the success of ff_queue_push_back().

Fixes: af052f9066 ("lavfi/dnn: fix mem leak in TF backend error handle")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
2025-08-13 19:50:26 +08:00
Michael Niedermayer
fd31df4306 tools: Split the list of source plugins out of "merge-all-source-plugins" 2025-08-13 11:50:52 +00:00
Michael Niedermayer
b5b306ca31 tools/merge-all-source-plugins: Fix merge_internal() return code
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-13 11:50:52 +00:00
Michael Niedermayer
373bd80b16 avcodec/dxv: Use av_fast_realloc() for op_data
makes things consistent

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-13 10:12:07 +00:00
Michael Niedermayer
4e5f25c0a5 avcodec/dxv: Clear ctex
same issue as with tex

Fixes: 431665305/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DXV_DEC_fuzzer-5339599339847680
Fixes: use of uninitialized memory

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-13 10:12:07 +00:00
Michael Niedermayer
6a8c41dcac avcodec/dxv: Check that we initialize op_data
Fixes: 431665305/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DXV_DEC_fuzzer-5339599339847680
Fixes: use of uninitialized memory

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-13 10:12:07 +00:00
Michael Niedermayer
4a0b793737 avcodec/dxv: Use av_fast_realloc() and clear all new space
The code writing in the buffer has a wide range of error checks
which simply leave it partly uninitialized.

Initializing it on allocation ensures no sensitive data leaks and that
bugs are more reliably reproduceable

Fixes: use of uninitialized memory
Fixes: 435225510/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DXV_DEC_fuzzer-4521918634196992

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-13 10:12:07 +00:00
Michael Niedermayer
d5bdb0b705 avcodec/sanm: Check mv in codec48_block()
Fixes: out of array read
Fixes: 436943287/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SANM_fuzzer-5011037029203968

This issue did oddly enough, not replicate

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-13 10:12:07 +00:00
Andy Nguyen
870cfed231 avformat/aviobuf: Free white/black list in avio_context_free()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-13 09:46:36 +00:00
Marton Balint
b61e510e75 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>
2025-08-12 21:56:09 +00:00
James Almer
3ef2ea890b avcodec/apv_decode: set decoder as skip frame fill param capable
No need to decode potentially huge frames just to get stream params.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-08-12 19:59:21 +00:00
James Almer
084b67f6e3 avcodec/apv: port to the receive_frame() API
You can technically feed the decoder a single packet with more than one AU in
it, even if a demuxer is unlikely to ever export such a thing.
Given the parser does no packetization to ensure we get a single AU, in order
to not discard any frame beyond the first, the decoupled input/output API
should be used.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-08-12 19:59:21 +00:00
James Almer
4b39d776c3 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>
2025-08-12 19:59:21 +00:00
Michael Niedermayer
0469d68acb avcodec/exr: Check for pixel type consistency in DWA
Fixes: out of array access
Fixes: BIGSLEEP-436511754/testcase.exr

Found-by: Google Big Sleep
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-12 12:21:09 +02:00
Dale Curtis
069201c535 avcodec/h264_refs: Make ff_h264_build_ref_list stricter with AV_EF_EXPLODE
Don't silently skip errors when AV_EF_EXPLODE is specified.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-12 11:38:45 +02:00
Dash Santosh
6f9e8a599d checkasm/swscale: fix whitespace issues 2025-08-12 09:05:00 +00:00
Dash Santosh
ca2a88c1b3 swscale/output: Implement yuv2nv12cx neon assembly
yuv2nv12cX_2_512_accurate_c:                          3540.1 ( 1.00x)
yuv2nv12cX_2_512_accurate_neon:                        408.0 ( 8.68x)
yuv2nv12cX_2_512_approximate_c:                       3521.4 ( 1.00x)
yuv2nv12cX_2_512_approximate_neon:                     409.2 ( 8.61x)
yuv2nv12cX_4_512_accurate_c:                          4740.0 ( 1.00x)
yuv2nv12cX_4_512_accurate_neon:                        604.4 ( 7.84x)
yuv2nv12cX_4_512_approximate_c:                       4681.9 ( 1.00x)
yuv2nv12cX_4_512_approximate_neon:                     603.3 ( 7.76x)
yuv2nv12cX_8_512_accurate_c:                          7273.1 ( 1.00x)
yuv2nv12cX_8_512_accurate_neon:                       1012.2 ( 7.19x)
yuv2nv12cX_8_512_approximate_c:                       7223.0 ( 1.00x)
yuv2nv12cX_8_512_approximate_neon:                    1015.8 ( 7.11x)
yuv2nv12cX_16_512_accurate_c:                        13762.0 ( 1.00x)
yuv2nv12cX_16_512_accurate_neon:                      1761.4 ( 7.81x)
yuv2nv12cX_16_512_approximate_c:                     13884.0 ( 1.00x)
yuv2nv12cX_16_512_approximate_neon:                   1766.8 ( 7.86x)

Benchmarked on:
Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) CPU
3417 Mhz, 12 Core(s), 12 Logical Processor(s)
2025-08-12 09:05:00 +00:00
Logaprakash Ramajayam
49477972b7 swscale/aarch64/output: Implement neon assembly for yuv2planeX_10_c_template()
yuv2yuvX_8_2_0_512_accurate_c:                        2213.4 ( 1.00x)
yuv2yuvX_8_2_0_512_accurate_neon:                      147.5 (15.01x)
yuv2yuvX_8_2_0_512_approximate_c:                     2203.9 ( 1.00x)
yuv2yuvX_8_2_0_512_approximate_neon:                   154.1 (14.30x)
yuv2yuvX_8_2_16_512_accurate_c:                       2147.2 ( 1.00x)
yuv2yuvX_8_2_16_512_accurate_neon:                     150.8 (14.24x)
yuv2yuvX_8_2_16_512_approximate_c:                    2149.7 ( 1.00x)
yuv2yuvX_8_2_16_512_approximate_neon:                  146.8 (14.64x)
yuv2yuvX_8_2_32_512_accurate_c:                       2078.9 ( 1.00x)
yuv2yuvX_8_2_32_512_accurate_neon:                     139.0 (14.95x)
yuv2yuvX_8_2_32_512_approximate_c:                    2083.7 ( 1.00x)
yuv2yuvX_8_2_32_512_approximate_neon:                  140.5 (14.84x)
yuv2yuvX_8_2_48_512_accurate_c:                       2010.7 ( 1.00x)
yuv2yuvX_8_2_48_512_accurate_neon:                     138.2 (14.55x)
yuv2yuvX_8_2_48_512_approximate_c:                    2012.6 ( 1.00x)
yuv2yuvX_8_2_48_512_approximate_neon:                  141.2 (14.26x)
yuv2yuvX_10LE_16_0_512_accurate_c:                    7874.1 ( 1.00x)
yuv2yuvX_10LE_16_0_512_accurate_neon:                  831.6 ( 9.47x)
yuv2yuvX_10LE_16_0_512_approximate_c:                 7918.1 ( 1.00x)
yuv2yuvX_10LE_16_0_512_approximate_neon:               836.1 ( 9.47x)
yuv2yuvX_10LE_16_16_512_accurate_c:                   7630.9 ( 1.00x)
yuv2yuvX_10LE_16_16_512_accurate_neon:                 804.5 ( 9.49x)
yuv2yuvX_10LE_16_16_512_approximate_c:                7724.7 ( 1.00x)
yuv2yuvX_10LE_16_16_512_approximate_neon:              808.6 ( 9.55x)
yuv2yuvX_10LE_16_32_512_accurate_c:                   7436.4 ( 1.00x)
yuv2yuvX_10LE_16_32_512_accurate_neon:                 780.4 ( 9.53x)
yuv2yuvX_10LE_16_32_512_approximate_c:                7366.7 ( 1.00x)
yuv2yuvX_10LE_16_32_512_approximate_neon:              780.5 ( 9.44x)
yuv2yuvX_10LE_16_48_512_accurate_c:                   7099.9 ( 1.00x)
yuv2yuvX_10LE_16_48_512_accurate_neon:                 761.0 ( 9.33x)
yuv2yuvX_10LE_16_48_512_approximate_c:                7097.6 ( 1.00x)
yuv2yuvX_10LE_16_48_512_approximate_neon:              754.6 ( 9.41x)

Benchmarked on:
Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) CPU
3417 Mhz, 12 Core(s), 12 Logical Processor(s)
2025-08-12 09:05:00 +00:00
Niklas Haas
5929d46f7b avfilter/vf_vignette: use AVFilterContext for logging 2025-08-12 09:01:39 +00:00
Niklas Haas
ec3c9ecaa7 avfilter/vf_tonemap: use AVFilterContext for logging 2025-08-12 09:01:39 +00:00
Niklas Haas
a75f673713 avfilter/vf_selectivecolor: use AVFilterContext for logging 2025-08-12 09:01:39 +00:00
Niklas Haas
2cdf4f08b4 avfilter/vf_scdet_vulkan: use AVFilterContext for logging 2025-08-12 09:01:39 +00:00
Niklas Haas
7751f261de avfilter/vf_scdet: use AVFilterContext for logging 2025-08-12 09:01:39 +00:00
Niklas Haas
dee56511b0 avfilter/vf_scale_vulkan: use AVFilterContext for logging 2025-08-12 09:01:39 +00:00
Niklas Haas
bd59c6651b avfilter/vf_photosensitivity: use AVFilterContext for logging 2025-08-12 09:01:39 +00:00
Niklas Haas
663a37f7f9 avfilter/vf_libvmaf: use AVFilterContext for logging 2025-08-12 09:01:39 +00:00
Niklas Haas
a45113c28a avfilter/vf_libplacebo: use AVFilterContext for logging 2025-08-12 09:01:39 +00:00
Niklas Haas
ea72804295 avfilter/vf_gblur_vulkan: use AVFilterContext for logging 2025-08-12 09:01:39 +00:00
Niklas Haas
d1d64c804e avfilter/vf_freezedetect: use AVFilterContext for logging 2025-08-12 09:01:39 +00:00