Commit graph

123292 commits

Author SHA1 Message Date
Michael Niedermayer
56217dccd6
avutil/timecode: Check for integer overflow in av_timecode_init_from_components()
Fixes: integer overflow
Fixes: testcase that calls av_timecode_init_from_components() with hh set explicitly to INT_MAX

Found-by: Youngjae Choi, Mingyoung Ban, Seunghoon Woo
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit eb5d607861)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-03-15 00:49:56 +01:00
Gil Portnoy
4f72addce1
avcodec/cbs_h266_syntax_template: Fix rows vs columns
Fixes: out of array access
Fixes: vvc_poc_cbs_divergence_max.h266

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 51606de0e9)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-03-15 00:49:56 +01:00
Ted Meyer
1f217b4b7d
avformat/mov: do not allocate out-of-range buffers
There's a possibility here with a well-crafted MP4 file containing only
the nested boxes in order: MOOV.TRAK.MDIA.MINF.STBL.SDTP where the
header size uses the 64 bit large size, and the ending stdp box has some
size value >= 0x100000014.

On a 32 bit build of ffmpeg, av_malloc's size parameter drops the high
order bits of `entries`, and and the allocation is now a controlled size
that is significantly smaller than `entries`. The following loop will
then write off the ended of allocated memory with data that follows the
box fourcc.

(cherry picked from commit 86f53f9ffb)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-03-15 00:49:56 +01:00
Karl Mogensen
0ce7bd66a7
avfilter/af_lv2: call lilv_instance_activate before lilv_instance_run
Why: the change is done to comply with lilv expectations of hosts.

Added call lilv_instance_activate in the config_output function to abide by lilv documentation that states it must be called before lilv_instance_run:
"This MUST be called before calling lilv_instance_run()" - documentation source (https://github.com/lv2/lilv/blob/main/include/lilv/lilv.h)

Added call lilv_instance_deactivate in the uninit function to abide by lv2 documentation:
"If a host calls activate(), it MUST call deactivate() at some point in the future" - documentation source (https://gitlab.com/lv2/lv2/-/blob/main/include/lv2/core/lv2.h)

Added instance_activated integer to LV2Context struct to track if instance was activated and only do lilv_instance_deactivate if was activated to abide by lv2 documentation:
"Hosts MUST NOT call deactivate() unless activate() was previously called." - documentation source (https://gitlab.com/lv2/lv2/-/blob/main/include/lv2/core/lv2.h)

Regarding the patcheck warning (possibly constant :instance_activated):
This is a false positive since the struct member is zero-initialized.

Fixes: trac issue #11661 (https://trac.ffmpeg.org/ticket/11661)
Reported-by: Dave Flater
Signed-off-by: Karl Mogensen <karlmogensen0@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit fa281d1394)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-03-15 00:49:56 +01:00
Zhao Zhili
2803bcd5d5
avformat/rtmpproto: fix listen_timeout conversion for special negative values
rtmpproto converts listen_timeout to milliseconds by multiplying it
by 1000 before passing it to TCP. However, negative values are special
sentinels (e.g., -1 for infinite wait) and should not be multiplied.

This worked prior to commit 49c6e6cc44 because there was no range
validation. Since that commit, ff_parse_opts_from_query_string
validates option values against their declared ranges, causing these
multiplied negative values to fail.

Fixes ticket #22469.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
(cherry picked from commit f189657ec6)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-03-15 00:49:56 +01:00
Michael Niedermayer
2cf15d3fc0
avcodec/aom_film_grain: Remove impossible check
fgp is freshly allocated so it cannot be equal to ref

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b4b569f922)
2026-03-15 00:49:55 +01:00
Michael Niedermayer
c9cf8cf9c3
avcodec/aom_film_grain: avoid duplicate indexes in ff_aom_parse_film_grain_sets()
Fixes: use after free
Fixes: 478301106/clusterfuzz-testcase-minimized-ffmpeg_dem_HEVC_fuzzer-6155792247226368

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 ebb6ac1bc7)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-03-15 00:49:55 +01:00
Michael Niedermayer
21719ece26
avformat/hxvs: Do not allow backward steps in hxvs_probe()
Fixes: infinite loop
Fixes: 487632033/clusterfuzz-testcase-minimized-ffmpeg_dem_IMAGE2_fuzzer-4565877872984064

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 4ccad70d57)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-03-15 00:49:55 +01:00
Michael Niedermayer
b842218402
swscale/output: fix integer overflows in chroma in yuv2rgba64_X_c_template()
Fixes: signed integer overflow: 130489 * 16525 cannot be represented in type 'int'
Fixes: 488950053/clusterfuzz-testcase-minimized-ffmpeg_SWS_fuzzer-4627272670969856

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 3b98e29da8)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-03-15 00:49:55 +01:00
Michael Niedermayer
c88ae59e31
avcodec/lcldec: Fixes uqvq overflow
Fixes: integer overflow
Fixes: 490241717/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ZLIB_DEC_fuzzer-4560518961758208

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 7241b80422)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-03-15 00:49:55 +01:00
Olivier Laflamme
711b69c615
fftools/ffprobe: Initialize data_dump_format_id
This was used uninitialized previously

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 10d36e5d3d)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-03-15 00:49:55 +01:00
Michael Niedermayer
511387e49a
avformat/aiffdec: Check for partial read
Fixes: read of uninitialized memory
Fixes: 490305404/clusterfuzz-testcase-minimized-ffmpeg_dem_AIFF_fuzzer-6406386140643328

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 ba0f8083fd)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-03-15 00:49:54 +01:00
Lynne
c9a5f7c6ca
hwcontext_vulkan: deprecate AVVulkanDeviceContext.lock/unlock_queue
Without replacement, as VK_KHR_internally_synchronized_queues will be required.

(cherry picked from commit c102e89448)
2026-03-14 18:54:46 +01:00
James Almer
680ac1aa32 avcodec/lcevc_parser: check return value of init_get_bits8()
Fixes coverity issue CID 1684198.

Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit a9984fec81)
2026-03-13 09:06:53 -03:00
James Almer
b013bbf092 avcodec/lcevc_parser: Check that block_size is not negative
Based on 248b481c33

Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 125bb2e045)
2026-03-13 09:06:53 -03:00
Michael Niedermayer
d8d4a96414 avcodec/bsf/extract_extradata: Replace incorrect size accounting
Fixes: out of array writes
Fixes: 492054712/clusterfuzz-testcase-minimized-ffmpeg_BSF_EXTRACT_EXTRADATA_fuzzer-5705993148497920

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 f84c859ec5)
2026-03-12 23:17:53 -03:00
Lynne
b1da475805
ffv1enc_vulkan: fix typo
Fixes a segfault when host mapping is unsupported.

(cherry picked from commit 215e22d1f1)
2026-03-10 19:32:38 +01:00
nyanmisaka
b6db764c86
fftools/ffmpeg: fix read_key() always return 255 when there was no input
fixup 08d327e

When an uchar is set to -1, it will become 255 when read as an int.
Duplicate variables for two terminal types can also avoid unused variable warnings.

(cherry picked from commit 3f10a054dc)

Signed-off-by: nyanmisaka <nst799610810@gmail.com>
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2026-03-09 17:17:17 +01:00
Michael Niedermayer
0ab823b47a avcodec/bsf/extract_extradata: Check that block_size is not negative
Fixes: out of array access
Fixes: 490576036/clusterfuzz-testcase-minimized-ffmpeg_BSF_EXTRACT_EXTRADATA_fuzzer-4605696279904256

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 248b481c33)
Signed-off-by: James Almer <jamrial@gmail.com>
2026-03-08 20:36:52 -03:00
Michael Niedermayer
67c886222f
Bump versions for release/8.1
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-03-08 02:29:20 +01:00
Michael Niedermayer
5e933b463b
doc/APIchanges: Fill in missing values
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-03-08 02:29:20 +01:00
Michael Niedermayer
82c55b7ed7
Changelog: Add Version 8.1 marker
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-03-08 01:42:57 +01:00
James Almer
ebf70aa854 avformat/demux: update Stream Groups in avformat_find_stream_info() from parsed values
Dimensions are not available at the container level for LCEVC in mpegts, so derive them
from the parsed values taken from the enhancement stream.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-03-07 19:22:42 -03:00
James Almer
b9cb948ec1 avformat/mpegts: add support for LCEVC streams
As defined in ITU-T H.222.0 v9, LCEVC streams use the "Byte stream format"
defined in Annex B of ISO/IEC 23094-2:2021.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-03-07 19:22:42 -03:00
James Almer
0cd4bb2f96 avcodec: add an LCEVC parser
Signed-off-by: James Almer <jamrial@gmail.com>
2026-03-07 19:22:40 -03:00
James Almer
58052b484e avcodec/codec_desc: make LCEVC a video media type
Every container signals it as such, and the data media stream type is too
undefined and unsupported across the codebase that even if no standalone
decoder can be present for it, it's preferable to it.

This is technically an API break, but LCEVC support has been minimal until
now so it should be safe.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-03-07 19:22:14 -03:00
James Almer
c6057f4d96 fftools/ffmpeg_mux_init: don't autoselect video codecs known to lack decoders
They should not be given priority even in a stream copy scenario.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-03-07 19:21:44 -03:00
James Almer
8add479cd3 avcodec/parser: set avctx->pix_fmt for codecs with the enhancement prop set
There will be no decoder for those, so the parser's derived value may be used.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-03-07 19:21:44 -03:00
James Almer
c23d56b173 avcodec/codec_desc: add a codec prop to signal enhancement layers
Some video codecs are not meant to output frames on their own but to be applied
on top of frames generated by other codecs, as is the case of LCEVC, Dolby Vision,
etc. Add a codec prop to signal this kind of codec, so that library users may know
to not expect a standalone decoder for them to be present.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-03-07 19:21:38 -03:00
Andreas Rheinhardt
2f9d3ce5a2 avcodec/h261dec: Don't pretend decoding a skipped macroblock can fail
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-03-07 20:14:36 +01:00
Andreas Rheinhardt
f37cfb370f avcodec/avcodec: Deprecate intra_dc_precision
It is only used by the MPEG-2 encoder, so replace it
by a private option instead. Use a more elaborate term
for it: intra_dc_precision ("dc" could be anything).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-03-07 20:14:36 +01:00
Andreas Rheinhardt
cdc632efb3 avcodec/mpegvideo_enc: Ignore intra_dc_precision for non-MPEG-2
This option is only allowed to be set for MPEG-2, so ignore it
except for MPEG-2 and move handling of it to mpeg12enc.c.
This is in preparation for deprecating the AVCodecContext option.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-03-07 20:14:36 +01:00
Andreas Rheinhardt
76a005dccf avcodec/rv10enc: Set encode_picture_header in rv10_encode_init()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-03-07 20:14:36 +01:00
Andreas Rheinhardt
8a431cd8ba avcodec/rv10enc: Check dimensions once during init
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-03-07 20:14:36 +01:00
Andreas Rheinhardt
27d95c3cf8 avcodec/mpegvideo_enc: Move dimension-alignment check to rv10enc.c
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-03-07 20:14:36 +01:00
Andreas Rheinhardt
9051caa12c avcodec/mpegvideo_enc: Inline intra_dc_precision when known
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-03-07 20:14:36 +01:00
Andreas Rheinhardt
ee72731722 tests/fate/vcodec: Test intra_dc_precision
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-03-07 20:14:36 +01:00
Andreas Rheinhardt
38c578b909 swscale_x86/swscale_template: Remove unused macros
WRITEBGR24MMX is unused after a05f22eaf3.

Reviewed-by: Niklas Haas <ffmpeg@haasn.dev>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2026-03-07 18:06:43 +01:00
James Almer
6dd446918a swscale/utils: don't abort early in sws_freeContext() for non legacy API
There are some buffers still allocated even with it.
Fixes memleaks.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-03-07 15:46:23 +00:00
Lynne
5a6eeed9f0
vulkan_ffv1: warn users on low number of slices
Files with a low amount of slices take a considerably longer amount
of time to decode. Experimentally, 16 seems to be a good safe minimum.
2026-03-07 15:14:25 +01:00
Lynne
8f2dea9ae8
Changelog: add entry for the prores Vulkan encoder 2026-03-07 15:14:21 +01:00
Lynne
b8a4d8a18d aacdec_usac_mps212: fix CID 1681700
Fixes Coverity issue #1681700
2026-03-07 11:56:47 +00:00
Lynne
c40318d663 aacdec_usac_mps212: Fix CID 1681701
Fixes Coverity issue #1681701
2026-03-07 11:56:47 +00:00
Lynne
46cf8f1873 aacdec_usac_mps212: fix CID 1681703
Fixes Coverity issue #1681703
2026-03-07 11:56:47 +00:00
Lynne
558738a6d0 aacdec_usac_mps212: Fix CID 1681704
Fixes Coverity issue #1681704
2026-03-07 11:56:47 +00:00
Lynne
e7e001a804 aacdec_usac_mps212: fix CID 1681705
Fixes Coverity issue #1681705
2026-03-07 11:56:47 +00:00
Devraj Ajmera
4a390fcd20
avformat/rtpenc: validate MPEG-TS RTP payload size
Ensure that the RTP payload size is at least one TS packet
(188 bytes) when packetizing MPEG-TS.

Previously, small payload sizes were silently rounded up,
which could lead to incorrect behavior. Return EINVAL
with a clear error message instead.

Signed-off-by: Devraj Ajmera <devrajajmera077@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-03-07 12:17:27 +01:00
Michael Niedermayer
c2364e9222 avcodec/aac/aacdec_usac_mps212: Fix invalid array index
Without the specification, limiting the index is the best that can be done.

Fixes: out of array access
Fixes: 487591441/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_LATM_fuzzer-6205915698364416

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-03-07 11:11:52 +00:00
Michael Niedermayer
c4ee599760 avcodec/aac/aacdec_usac_mps212: Fix invalid shift
Fixes: left shift of negative value -2
Fixes: 487591441/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_LATM_fuzzer-6205915698364416

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-03-07 11:11:52 +00:00
Michael Niedermayer
1e7d7c4f52
fftools/ffmpeg_demux: Check metadata provided filename
Fixes: path traversal with  -dump_attachment:t
Fixes: malicious.mkv

Based on code from libavformat/concatdec.c
This will be factored out possibly into libavutil once there is agreement on the API

Found-by: Shangzhi Xu <mxu490469@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-03-07 11:51:39 +01:00