1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-11-29 05:57:37 +02:00
Commit Graph

121013 Commits

Author SHA1 Message Date
Niklas Haas
c96ccd78fc avfilter/vf_colordetect: rename p, q, k variables for clarity
Purely cosmetic.

Motivated in part because I want to depend on the assumption that P
represents the maximum alpha channel value.
2025-08-18 18:50:00 +00:00
Niklas Haas
2968f30a15 tests/checkasm/vf_colordetect: also test opaque alpha base case
Preemptively adding a check for a following commit.
2025-08-18 18:50:00 +00:00
Niklas Haas
34ad857d2b avfilter/vf_colordetect: slightly change detect_alpha() signature
Basically cosmetic.

I want to expand this to detect more than a single property about the alpha
channel at the same time; so we first need a way for this function to
return a more complex result.

Move the enum AlphaMode to the header and formally generalize the return
signature a bit to allow returning more than just one value.
2025-08-18 18:50:00 +00:00
Andreas Hartmann
11a89bfe7b ffmpeg_opt: Parse regular options in ffpreset files
instead of only AV-specific options. The previous code assumed that any
option not defining the codec in an `ffpreset` file is an AVOption. This
for example prevented the use of options defined in `OptionDef[]`, like
`-pix_fmt`, as part of preset files, requiring users to type these out
every time.

Closes: #1530
Signed-off-by: Andreas Hartmann <hartan@7x.de>
2025-08-18 13:54:30 +00:00
Zane van Iperen
d5c8f2268f .forgejo/CODEOWNERS: add myself to relevant files
To formats I've written in lavf, and adpcm-related things in lavc.

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2025-08-18 09:51:41 -04:00
Manuel Lauss
0226b6fb2c avcodec/sanm: bl16: fix artifacts in larger videos
The DOS/Windows decoder precomputes a table of linear offsets of
all motion vectors given the current image width.
For larger widths (>=762), the pairs starting at indices 1 and 254
of motion_vectors[] will overflow the int16_t, changing the sign.

Playing back the 800x600 "jonesopn_8.snm" video of "Indiana Jones and
the Infernal Machine" reveals a lot of artifacts and a lot of
"Ignoring invalid motion vector (149, -41)->(136, 0), block size = 8"
messages, hinting at the wrong direction of the motion vectors.

Fix this by doing the calculation that the DOS/Windows players do,
let the value overflow and reextract the "new" mvec x/y components.
2025-08-18 09:11:09 +00:00
Valerii Zapodovnikov
8426622bb9 avformat/avio: clarify that AVSEEK_FORCE has no effect
avio_seek() never supported SEEK_END and returned AVERROR(EINVAL) when
specified, so the later check "(whence != SEEK_END || force)" was always true.

This also means that AVSEEK_FORCE had no effect since 7a6fe01f99, that is 15
years ago. Rather than changing behaviour, let's document instead that the flag
has no effect.

Also fixed other commit 41ed7ab45f which confused ORing / passing AVSEEK_FORCE
and AVSEEK_SIZE in the docs.

Signed-off-by: Valerii Zapodovnikov <val.zapod.vz@gmail.com>
2025-08-17 20:47:11 +00:00
Michael Niedermayer
134fbfd1dc avcodec/sanm: Check w,h,left,top
The setup code fow w,h,left,top is complex, the code using it also falls in
at least 2 different classes, one using left/top the other not.

To ensure no out of array access happens we add this clear check.

Fixes: out of array access
Fixes: 439261995/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SANM_fuzzer-5383455572819968

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-17 15:39:33 +02:00
James Almer
a2cfaf1b91 avformat/mov: pass stream index to sanity_checks on HEIF images
Instead of item_id. Same behavior as with standard video tracks.

Signed-off-by: James Almer <jamrial@gmail.com>
2025-08-16 21:59:18 -03:00
James Almer
a28e01a6c1 avformat/mov: don't use an allocated array for sample_size with HEIF images
The array is only ever needed for streams where each sample entry may have a
different value. Given that for non animated HEIF there's a single value that
applies to the image, use the field defined for that.

Fixes: NULL pointer dereference
Fixes: 437528618/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6537287645331456

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-16 21:59:18 -03:00
Gyan Doshi
7df9271272 avfilter/whisper: correct option formatting 2025-08-17 00:58:03 +00:00
Zhao Zhili
1d06e8ddcd avfilter/af_whisper: fix broken output for multibyte character
text + 1 can break a multibyte character, e.g., Chinese in UTF-8.
There is no space at the beginning in this case.
2025-08-16 13:58:14 +00:00
Leo Izen
30e6956920 .forgejo/CODEOWNERS: add myself to JPEG XL and PNG
Add myself to JPEG XL and PNG decoders/encoders/parsers/etc. as a
suggested reviewer. I'm the maintainer of the JXL files and I know the
PNG code very well.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2025-08-16 05:07:19 -04:00
Jack Lau
37507c6a78 avformat/whip: remove DTLSState enum
This patch aims to simplify the dtls handshake process
since dtls handshake use force block mode

We can just use the return code instead of DTLSState enum

Signed-off-by: Jack Lau <jacklau1222@qq.com>
2025-08-16 06:25:04 +00:00
Michael Niedermayer
50affd2b09 avcodec/rv60dec: clear pu_info
pu_info is read uninitialized on damaged input and at that point the following codepath is dependant
on the uninitialized data. In one of these pathes out of array accesses happen.
None of this is replicatable

Less uninitialized data also should result in more reproducable reports

Fixes: Use of uninitialized memory
Fixes: 418335931/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RV60_fuzzer-5103986067963904

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-16 00:24:52 +00:00
Kacper Michajłow
61d0050924 avformat/tls_openssl: simplify fingerprint generation
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-16 00:15:30 +00:00
Kacper Michajłow
4676f97928 avformat/tls_openssl: clean keys serialization
It was unnecessary convoluted, remove not needed memory allocations,
snprintf.

Also fixes posibility to call snprinft with NULL as %s input.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-16 00:15:30 +00:00
Kacper Michajłow
113c9c6cf3 configure: require at least OpenSSL 1.1.1 (LTS)
Commit f256487cd8 bumped requirement to
1.1.0 for OPENSSL_init_ssl.

Bump this again to 1.1.1, because it was an LTS version. Although it has
no mainline support anymore, it still has paid/premium support. 1.1.0 has
no support at all.

Motivated for use of BIO_read_ex() for next commits.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-16 00:15:30 +00:00
Kacper Michajłow
3a8b3dfeca avformat/tls_openssl: use ascii - (0x2D) instead of 0x2010 hyphen
Too much AI is bad for you...

Fixes: 167e343bbe
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-16 00:15:30 +00:00
Kacper Michajłow
1f4fed5cc3 w32pthreads: add support for setting thread name
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-15 19:54:01 +00:00
Kacper Michajłow
5ff2500514 avcodec/x86/Makefile: add missing x86/proresdsp.o for prores raw 2025-08-15 20:45:20 +02:00
wangbin
6e48050568 configure: fix -L flags for lld-link 2025-08-15 18:20:33 +00:00
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