1
0
mirror of https://git.ffmpeg.org/ffmpeg.git synced 2026-10-24 02:09:03 +03:00
Commit Graph

27209 Commits

Author SHA1 Message Date
Omkhar Arasaratnam
cd5bddbf1d avformat/tls_openssl: bind peer identity for numeric-IP verify
tls_open() installed a peer-identity target only when the URL host was
non-numeric. For a numeric-IP target the whole block was skipped, so
with verify=1 OpenSSL validated the chain to a trusted CA but bound no
identity, and any publicly-trusted certificate for any name was accepted
(e.g. tls://203.0.113.10?verify=1).

Run the identity block for every non-listening connection. Classify
s->host with the same getaddrinfo(AI_NUMERICHOST) rule tls.c uses. A
numeric host is pinned to the certificate's iPAddress SAN by handing
OpenSSL the parsed binary address via X509_VERIFY_PARAM_set1_ip();
everything else, including a verifyhost=<name> override, binds by name
via SSL_set1_host(). Passing the binary address rather than re-probing
the ASCII form pins legacy numeric spellings such as 2130706433 as IPs
instead of letting them fall back to hostname matching. SNI is still
suppressed for numeric transport hosts (RFC 6066 sec. 3) via
s->numerichost.

The identity target is installed unconditionally for non-listening
connections; whether the certificate is actually verified stays
controlled separately by SSL_CTX_set_verify() under s->verify, so
disabling verification keeps the prior behaviour. Sets AVERROR_EXTERNAL
with an explicit log line on failure.

dtls_open() sets s->is_dtls and then calls tls_open(), so DTLS client
connections run through the same identity block and are covered here.

Found-by: Claude (Anthropic). Human-verified and reported by
Omkhar Arasaratnam <omkhar@linkedin.com>.
Signed-off-by: Omkhar Arasaratnam <omkhar@linkedin.com>
(cherry picked from commit 83c6922826)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-09-19 14:26:59 +02:00
Michael Niedermayer
9380c3f6d2 avformat/codec2: avoid integer overflow in packet size and duration
Fixes: signed integer overflow
Fixes: 2jy_poc_codec2.zip / poc_codec2.raw
Fixes: jOQASNnOm6O7
Found-by: Jiale Yao <yaojiale02@163.com>
(cherry picked from commit 2b7e501242)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-09-19 14:26:59 +02:00
Steven Liu
191715f023 avformat/hls: Enforce protocol checks when opening child playlists
Fix: vulnerability:019f3b84-903b-75fb-a8de-fad1c2d7e99c
The parse_playlist() path for opening a new child playlist (in == NULL)
directly called c->ctx->io_open(), bypassing the protocol whitelist and
file-extension checks that open_url() enforces. This allowed child URLs
from a master playlist to use protocols other than file/http/data or to
have disallowed extensions.

Route the !in branch through open_url() so that all child playlists are
subject to the same security policy as segment URLs.

Fixes a security bypass in HLS master playlist parsing.

Found-by: depthfirst
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
(cherry picked from commit 23602df9cd)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-09-19 14:26:58 +02:00
Steven Liu
b06f79094a avformat/hlsenc: Fix heap buffer overflow in parse_playlist()
Fix: vulnerability:019f3b84-903b-75fb-a8de-fe6f84d6bc32

When parsing IV=0x... followed by a comma, end - ptr was passed directly
to av_strlcpy() as the destination size. Since iv_string is only 33 bytes
(KEYSIZE*2 + 1), a long IV token could overflow into adjacent heap data.

Use FFMIN(end - ptr + 1, sizeof(buf)) to cap the copy size to the actual
buffer size. Apply the same fix to key_uri parsing for consistency.

Fixes a heap buffer overflow in append_list mode when reading an existing
playlist with a crafted IV or URI token length.

Found-by: depthfirst
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
(cherry picked from commit 275e217b10)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-09-19 14:26:58 +02:00
Steven Liu
96fed0a21e avformat/hlsenc: Handle extensionless URIs in extract_segment_number()
fix: vulnerability:019f3b84-90fb-737a-ae7a-b3e0219266fc
extract_segment_number() used strrchr(filename, '.') and immediately did
dot - 1 without checking for NULL. A segment URI with no extension would
cause undefined behavior (NULL pointer arithmetic) when resuming an
append_list playlist with subtitle variants.

Add a NULL check and return -1 early when no dot is found.

Fixes a crash/UB in HLS muxer resume path.

Found-by: depthfirst
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
(cherry picked from commit 601d9ee881)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-09-19 14:26:58 +02:00
Omkhar Arasaratnam
b1e368d816 avformat/tls_mbedtls: check the certificate verification result in tls_handshake()
tls_mbedtls verifies the peer certificate manually via
mbedtls_ssl_get_verify_result() (it uses MBEDTLS_SSL_VERIFY_OPTIONAL), but
only in tls_open(). On the external-socket path (external_sock=1) tls_open()
skips the handshake; it then runs later through the url_handshake hook,
tls_handshake(), which never checks the verification result, so with verify=1
an untrusted peer certificate would be accepted.

The only in-tree user of this path is the WHIP muxer, which sets verify=0
(WebRTC binds the peer via the SDP a=fingerprint, not a CA), so this is not
reachable today. This change is defence-in-depth: it makes tls_handshake()
honor verify symmetrically with the existing tls_open() check.

Signed-off-by: Omkhar Arasaratnam <omkhar@linkedin.com>
(cherry picked from commit b96701098f)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-09-19 14:26:57 +02:00
Michael Niedermayer
cc2a931122 avformat/concatdec: Check recursion depth
This variant is easy backportable but is concatdec specific

Fixes: self_ref.ffconcat
Reported-by: Yuhao Jiang <danisjiang@gmail.com>
Rediscovered-by: Anxious Koisi
Fixes: RWHkT0ASFMNI
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 58d39e99e2)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-09-19 14:26:57 +02:00
Michael Niedermayer
1d805749ba avformat/ty: don't let the Series2 AC3 trim underflow the packet size
Fixes: negative-size-param
Fixes: ty-s2-ac3-negative-size-single-file.ffconcat / create_poc.py
Fixes: g0qeE6KvrjZi
Found-by: Adrian Junge (vurlo)
(cherry picked from commit de771bd527)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-09-19 14:26:56 +02:00
Michael Niedermayer
a90817a062 avformat/spdif: fix reading past the buffer when probing AAC in IEC 61937
Fixes: read of uninitialized memory
Fixes: 528525234/clusterfuzz-testcase-minimized-ffmpeg_dem_W64_fuzzer-6429204661731328
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
(cherry picked from commit 15bbf3a21d)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-09-19 14:26:53 +02:00
Michael Niedermayer
cee320b72b avformat/hls_sample_encryption: Validate ADTS frame length against packet
Fixes: out of array access
Fixes: playlist.m3u8 / make_poc.py
Fixes: rJ50u41V7ctk
Fixes: ff958b3846 (libavformat/hls: add support for decryption of HLS media segments encrypted using SAMPLE-AES encryption method)
Found-by: Clouditera Security Research Team <haoyuliu@clouditera.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 976490dcc3)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-09-19 14:26:51 +02:00
Michael Niedermayer
0f1d664262 avformat/iff: reject invalid data_size in ANIM
Fixes: 520277418/clusterfuzz-testcase-minimized-ffmpeg_dem_IFF_fuzzer-6733106211258368
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 14604ec4b7)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-09-19 14:26:51 +02:00
Kacper Michajłow
a4ddaba8bb avformat/hls: reject Master Playlist tags in a Media Playlist
Fixes infinite loop on crafted HLS playlists.

Fixes: recursion.m3u8
Fixes: cEy2cxyyPaLH
Fixes: cd223e0b4e (Add Apple HTTP Live Streaming demuxer)
Found-by: BapToutatis
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
(cherry picked from commit c364ab176f)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-09-19 14:26:51 +02:00
Omkhar Arasaratnam
1b9040fc89 avformat/mov: bound the iref thmb/cdsc entry count by the sub-box size
Fixes: excessive parsing past the iref sub-box
Fixes: TMwMAJfgy3l9
Fixes: 74e430202d (avformat/mov: make items referencing items generic)
Found-by: Omkhar Arasaratnam
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit dcc18b6077)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-09-19 14:26:51 +02:00
Michael Niedermayer
a0cd1244ca avformat/wavdec: fix integer overflow in W64 chunk size check
Fixes: 523658585/clusterfuzz-testcase-minimized-ffmpeg_dem_W64_fuzzer-5454488994643968
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 3b28a08a32)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-09-19 14:26:50 +02:00
Pavel Kohout
32c3ca282b avformat/imfdec: check for a missing or empty Path in the asset map
Fixes: NULL pointer dereference
Fixes: vIIX7oqa3coO
Fixes: 73f6cce936 (avformat/imf: Demuxer)
Found-by: Pavel Kohout (Aisle Research)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 0fe4bd4b43)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-09-19 14:26:50 +02:00
Pavel Kohout
9473f54c36 avformat/imfdec: reject virtual tracks with no resources
Fixes: NULL pointer dereference
Fixes: kia6rom3mZdr
Fixes: 73f6cce936 (avformat/imf: Demuxer)
Found-by: Pavel Kohout (Aisle Research)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit a76190152d)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-09-19 14:26:49 +02:00
Michael Niedermayer
cbd2878853 avformat/movenc: free sgpd_entries on the roll-distance error path
Found-by: Ao Xijie
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b553b810c4)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-09-19 14:26:48 +02:00
Michael Niedermayer
90f51a94a8 avformat/mov: check current_dts for overflow
This includes a bunch of semi related checks that Fairy wanted added

Fixes: 498236160/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-4526018559016960
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 7e4366cf51)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-09-19 14:26:47 +02:00
Kacper Michajłow
45cf2200e1 avformat/hlsenc: initialize avg_bandwidth
Fixes use of uninitialized value and dumping it into AVERAGE-BANDWIDTH
in playlist. Note this will be correctly set when we are at final
segment, otherwise it's optional.

Fixes: fate-hls-seek test on MSAN build

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
(cherry picked from commit dc953a19e6)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-09-19 14:26:46 +02:00
Stefan Breunig
920fb52ea7 avformat/hlsplaylist: fix byte offsets for single_file+iframes_only
fix ticket: 8636

video_keyframe_size and video_keyframe_pos tracked the end of the
previous P/B frame. In the case of I-frame only videos, this would
result in byteoffsets always being 0@0 in the case of fmp4. For
mpegts, the size would be correct but the pos still always be @0.

Since size and pos already correctly track the start of a segment,
we can re-use them even in I-frame only mode.

(cherry picked from commit ea3d417d90)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-09-19 14:26:46 +02:00
James Almer
1005b294ff avformat/iamf: backport assorted fixes
Too many merge conflics to attempt individual cherry-picks.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-09-15 00:18:58 -03:00
James Almer
1a748fe2cd avformat/iamf_parse: bound the output mix gain duration by the audio elements
Based on a patch by Michael Niedermayer

Fixes: unbounded allocation
Fixes: poc_output_mix_config_dos.iamf
Fixes: 387qWpjUgeKH
Found-by: Duong Tran Thai (CyStack)
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit d2476bfd2b)
2026-08-28 03:29:31 +00:00
James Almer
657882fb6e avformat/iamf_parse: check that num_sub_mixes and num_audio_elements in Mix Presentations are not zero
As required by the spec in Section 3.7

Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 1b946a3abd)
2026-08-28 03:29:30 +00:00
Ackanir
ead50b713b avformat/movenc: fix crash when flushing a fragment with no data
mov_flush_fragment() calls ffio_reset_dyn_buf() on mov->mdat_buf when
writing the initial moov. That buffer is allocated lazily on the first
packet, so it is still NULL when the trailer is written before anything
was muxed, and ffio_reset_dyn_buf() dereferences it.

627da1111c replaced ffio_free_dyn_buf(), which tolerates NULL, with
ffio_reset_dyn_buf(), which does not, turning this case into a crash.

This affects every fragmented mode that defers the initial moov to the
first flush.

Skip the block entirely when the buffer was never opened. Nothing
references the empty mdat it would otherwise write, as no samples were
muxed.

Reproduced with:
ffmpeg -f lavfi -i color=s=64x64 -frames:v 0 -movflags +frag_keyframe out.mp4

Fixes: 627da1111c ("libavformat/movenc: Uses dynamic buffers for fragmented chunks")
Signed-off-by: Ackanir <git.ackanir@gmail.com>
(cherry picked from commit 9f35e220ff)
2026-08-28 00:06:58 +00:00
Pavel Kohout
c26e3cd2f8 avformat/rtpdec_asf: reject ASF objects smaller than their header
Fixes: infinite loop
Fixes: MzWwJdpZF2Ls
Fixes: c2f3eec445 (Implement RTSP-MS/ASF packet parsing.)
Found-by: Pavel Kohout (Aisle Research)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 11d5f475be)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 3c441711a3)
Signed-off-by: Adam Shaver <ashaver@nvidia.com>
2026-08-03 18:38:53 +00:00
Michael Niedermayer
9a92fb0034 avformat/spdifenc: bound DTS core_size against the packet size in the HD path
Fixes: out of array read
Fixes: yBSax492UIB9
Fixes: 482d98f69b (spdifenc: IEC 61937 encapsulation of DTS-HD for HDMI)
Found-by: Pavel Kohout (Aisle Research)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 6f80e27654)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 385ac2fadc)
Signed-off-by: Adam Shaver <ashaver@nvidia.com>
2026-08-03 18:38:53 +00:00
Pavel Kohout
4fe710047d avformat/vobsub: reuse subtitle streams and bound the stream count
Fixes: heap buffer overflow
Fixes: lqaO5R1BaZGO
Fixes: dbfe61100b (avformat/vobsub: fix several issues.)
Found-by: Pavel Kohout (Aisle Research)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit dbd495f066)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit dcf8ce2802)
Signed-off-by: Adam Shaver <ashaver@nvidia.com>
2026-08-03 18:38:53 +00:00
almogyalin
cfa62de001 avformat/iamf_parse: fix inverted subblock duration validation
The check on variable subblock durations had an inverted comparison, rejecting valid multi-subblock parameters and failing to catch subblock durations exceeding the remaining time.

(cherry picked from commit 1635b49b80402c8cec39eefb12f35e2ee7c13606)
2026-07-29 21:10:52 +00:00
Aditya Banavi
4d786a8648 avformat/tls_gnutls:fix crash when connecting to peer
When ffmpeg whip client takes up dtls_active role when using gnutls,
it tries to connect to the server over udp and intermittently crashes.
This is because s->host is NULL, and ffmpeg is in ice controlling mode.
The gnutls api - gnutls_server_name_set() crashes if the hostname is NULL.

This commit assigns valid value to s->host in such scenarios.

Signed-off-by: Aditya Banavi <adityabanavi@gmail.com>
(cherry picked from commit 28b92b9b2e)

The upstream fix calls ff_tls_parse_host(), which was introduced after this
branch point by commit df3511db5bdf; its host-parsing is inlined here rather
than backporting that refactor.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-16 17:52:37 +00:00
Franciszek Kalinowski
cb112ece1c avformat/icecast: reject CR/LF in metadata header values
Reported by Franciszek Kalinowski (isec.pl / striga.ai) and Bartosz Smigielski.

(cherry picked from commit 99e1ecca36)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-16 06:01:29 +02:00
bird
5c56b48dbe avformat/sctp: add size check in sctp_read() matching sctp_write()
Commit 5b98cea4 added a size < 2 guard to sctp_write() to prevent
out-of-bounds access when max_streams is enabled, but the identical
pattern in sctp_read() was not addressed.

When max_streams is non-zero, sctp_read() passes (buf + 2, size - 2)
to ff_sctp_recvmsg(). If size < 2, size - 2 wraps to a large value
on the implicit cast to size_t in the callee.

Add the same guard.

Signed-off-by: bird <6666242+bird@users.noreply.github.com>
(cherry picked from commit 5c3602abaa)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-16 05:52:32 +02:00
Michael Niedermayer
55db63567d avformat/mpegts: use av_fast_realloc() for prg
Fixes: Timeout
Fixes: 514855073/clusterfuzz-testcase-minimized-ffmpeg_dem_MPEGTS_fuzzer-5074757044469760
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 f7e6a8ade5)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-15 23:57:24 +02:00
jiale yao
faa81d0b18 avformat/rtpenc_amr: Check input size
Fixes: heap buffer overflow

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 71478d1165)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-15 23:57:22 +02:00
James Almer
1034b144ff avformat/iamf_writer: reject muxing PCM streams
Supporting PCM streams requires API changes present in newer releases that
can't be backported, so don't create invalid files.

Signed-off-by: James Almer <jamrial@gmail.com>
2026-06-14 10:06:31 -03:00
Michael Niedermayer
2dfc8f3919 avformat/rtspdec: bound Content-Length in the ANNOUNCE handler to SDP_MAX_SIZE
Reported by Franciszek Kalinowski (isec.pl / striga.ai) and Bartosz Smigielski.

(cherry picked from commit 6049b4d7bc)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:41:07 +02:00
haoyuLiu
8280545165 avformat/http: reject request-line tokens not terminated by whitespace
Fixes out of array access

Found-by: Cloud-LHY (@Clouditera-lhy) / VulnForge Security Research Team
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit dd9083cb89)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:41:07 +02:00
Michael Niedermayer
31a192f5dd avformat/mov: reject out of range ispe dimensions, avoid overflow summing HEIF tile dimensions
ispe width/height are read as uint32 but stored in int HEIFItem fields;
values above INT_MAX became negative, and read_image_grid() summing such
widths into coded_width overflowed int:
libavformat/mov.c:10404:33: runtime error: signed integer overflow: -2147483647 + -2147483647 cannot be represented in type 'int'

Also accumulate the grid tile dimensions and running offsets in 64bit
and validate the totals, as up to 256 tile columns of individually
valid widths can still overflow int.

Found-by: 51511
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2cc7b87bdb)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:41:06 +02:00
David Korczynski
a0e7ee5468 avformat/dhav: Fix second integer overflow in get_duration()
Fixes: ada-2-poc.dhav

Found-by: Claude and Ada Logics. This issue was found by Anthropic from using agents to study security of open source projects, and I am from Ada Logics helping validate the found issues and report to maintainers.
(cherry picked from commit 50e65074f5)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:41:06 +02:00
Michael Niedermayer
e15ede87a3 avformat/matroskadec: avoid signed overflow in DASH cue time differences
Fixes: 493466409/clusterfuzz-testcase-minimized-ffmpeg_dem_WEBM_DASH_MANIFEST_fuzzer-6150181551931392
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 0a8d961388)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:41:04 +02:00
Michael Niedermayer
d4175fe20d avformat/dashdec: Fail with any inner stream count being 0
Fixes: ada-3-poc.mpd

Found-by: Claude and Ada Logics. This issue was found by Anthropic from using agents to study security of open source projects, and I am from Ada Logics helping validate the found issues and report to maintainers.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b99c6fc8c3)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:41:04 +02:00
Michael Niedermayer
46a66b2ccc avformat/gxfenc: Check timecode and propagate error
Fixes: ./ffmpeg   -f lavfi -i testsrc=duration=0.1:size=720x480:rate=30   -c:v mpeg2video -frames:v 1   -metadata timecode="999999999:00:00:00"   -f gxf output.gxf

Found-by: jiale yao
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 0ea090e09f)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:41:02 +02:00
Michael Niedermayer
e61c9faabd avformat/iamf_parse: bound substream count by remaining OBU size
also check for nb_substreams == 0

Fixes: 472641765/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-6390897173659648
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 fe2dabbbf4)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:41:02 +02:00
Michael Niedermayer
a6740266e0 avformat/matroskadec: bound TRACKENTRY parsing by max_streams
After the fix the reproducer finishes in 43 ms instead of OOM-ing at the
2 GB limit. Legitimate .mkv/.webm fate samples still parse cleanly.

Fixes: 471604245/clusterfuzz-testcase-minimized-ffmpeg_dem_WEBM_DASH_MANIFEST_fuzzer-6662979358883840
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 c7e0bac050)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:41:02 +02:00
Michael Niedermayer
363435f591 avformat/rtmppkt: Check recursion depth
Based on flvdec.c

Fixes: out of array access

Found-by: Xueqing
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 92804c9e25)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:41:01 +02:00
Omkhar Arasaratnam
89d9ad0345 avformat/mov: cap HEIF ICC profile copies via c*max_streams to bound CPU and memory
Found-by: Claude (Anthropic). Human-verified and reported by
Omkhar Arasaratnam <omkhar@linkedin.com>.
Signed-off-by: Omkhar Arasaratnam <omkhar@linkedin.com>
(cherry picked from commit 711cdae64f)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:41:00 +02:00
Michael Niedermayer
36abe87a0b avformat/iff: check av_get_packet() result in ANIM branch
Fixes: 494958338/clusterfuzz-testcase-minimized-ffmpeg_dem_IFF_fuzzer-6265824670449664
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 43f712d917)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:40:59 +02:00
Michael Niedermayer
61218852d1 avformat/mxfdec: Remove unneeded check
size is 16bit only

Found-by: Tomas Härdin
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit aaac0989e6)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:40:57 +02:00
Michael Niedermayer
0cda9f02e7 avformat/ftp: Check string used for RNTO
Found-by: Forgejo Fairy
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 4d24cb1c39)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:40:57 +02:00
Michael Niedermayer
bdcec7edb8 avformat/ftp: Check for Telnet IAC characters and other non printable ASCII chars
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 090838497c)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:40:57 +02:00
Franciszek Kalinowski
643048daef avformat/ftp: reject CR/LF in the URL path to prevent FTP command injection
ftp_connect() interpolates the URL path into SIZE/RETR/STOR/CWD/DELE/RMD/RNFR
commands without checking for CR/LF, although it already rejects CR/LF in the
user and password fields. Reject CR/LF in s->path the same way.

Reported and reviewed by Franciszek Kalinowski (isec.pl / striga.ai) and Bartosz Śmigielski.

(cherry picked from commit 640f32b1b6)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:40:56 +02:00