Commit Graph

125394 Commits

Author SHA1 Message Date
Michael Niedermayer
7bd23e2cb2 avcodec/mjpegdec: reject flipping of bayer images
Fixes: assertion failure
Fixes: 523522308/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_DEC_fuzzer-4771843818192896
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 40ce1513c6)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-07-21 22:59:56 +02:00
Michael Niedermayer
e18d1b7972 avcodec/tdsc: reject out-of-frame cursor position
Fixes: signed integer overflow
Fixes: 519649309/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TDSC_fuzzer-6322382028734464
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
(cherry picked from commit 8de8405796)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-07-21 22:59:55 +02:00
Michael Niedermayer
27f503c90e 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-07-21 22:59:55 +02:00
Michael Niedermayer
e6bcc30dcd avfilter/vf_v360: keep remap source coordinates in bounds
Two runtime paths could compute out-of-range source coordinates for
degenerate projection geometry, causing heap-buffer-overflow reads

Fixes: out of array read
Fixes: assertion failure
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit a73d648f6e)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-07-21 22:59:55 +02:00
Michael Niedermayer
85d7bb2280 avfilter/vf_v360: reject dimensions too small for the projection
Fixes: out of array read
Fixes: assertion failure
Fixes: mQzloVqnivHQ
Found-by: Anthony Hurtado
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b3712addc9)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-07-21 22:59:55 +02:00
Michael Niedermayer
ac507eac63 avcodec/lzf: pad the decompressed buffer
Fixes: out of array read
Fixes: oddlist.mov / poc.mov
Found-by: Clouditera Security; Z.ai Security; NSFOCUS
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit fe47696aa1)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-07-21 22:59:55 +02:00
Michael Niedermayer
89f146e6db avcodec/jpeg2000dec: avoid signed overflow in ROI shift
Fixes: 522402419/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_DEC_fuzzer-5987463315914752
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 90a285ca78)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-07-21 22:59:54 +02:00
Michael Niedermayer
bf316c1535 avcodec/hevc/ps: avoid signed overflow reading act qp offsets
Fixes: 523734452/clusterfuzz-testcase-minimized-ffmpeg_dem_HEVC_fuzzer-5246801451220992
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 c5150ad48b)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-07-21 22:59:54 +02:00
Michael Niedermayer
8ce7d391aa avcodec/vvc/dec: fix pixel buffer tab leak on chroma format change
Fixes: memleak
Fixes: 518575619/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VVC_fuzzer-5161396783611904
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
(cherry picked from commit a41f543113)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-07-21 22:59:54 +02:00
Michael Niedermayer
d7abdc8c85 avcodec/vvc/dec: merge the SAO and ALF pixel buffer tab loops
Both loops iterate over the same components and compute the same
per-component width and height. The order of tabs within a TabList
does not matter, so build all pixel buffer tabs in a single loop.

(cherry picked from commit df2649ffb1)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-07-21 22:59:54 +02:00
Michael Niedermayer
9d5704e4d9 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-07-21 22:59:54 +02:00
Michael Niedermayer
6727eb54e8 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-07-21 22:59:54 +02:00
Kacper Michajłow
0e6eef3551 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-07-21 22:59:53 +02:00
Omkhar Arasaratnam
1f51b7b87f 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-07-21 22:59:53 +02:00
Michael Niedermayer
7c0b8c8594 avcodec/lcldec: zero the not-decoded tail to avoid heap disclosure
Fixes: use of uninitialized memory
Fixes: CsNDKB1K1U0C
Fixes: e2c3aa8e2b (avcodec/lcldec: More space for rgb24)
Found-by: Adrian Junge (vurlo)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit e7cbfd1c50)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-07-21 22:59:53 +02:00
Michael Niedermayer
c20d78c683 avfilter/vf_quirc: resize the quirc buffers when the input size changes
Fixes: out of array access
Fixes: JbvzNObhorBp
Fixes: 030e140145 (lavfi: add quirc filter)
Found-by: Adrian Junge (vurlo)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 4da9812e25)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-07-21 22:59:53 +02:00
Michael Niedermayer
97e169f6ce swscale/output: avoid signed overflow in yuv2rgb_write_full luma scaling
Fixes: 523522305/clusterfuzz-testcase-minimized-ffmpeg_SWS_fuzzer-4574409678716928
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
(cherry picked from commit f50e22c68d)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-07-21 22:59:53 +02:00
Michael Niedermayer
eac6965d9c 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-07-21 22:59:52 +02:00
Michael Niedermayer
3d5ad47c40 avcodec/nvdec: don't double free the fdd-owned context on the sep_ref error path
Fixes: double free
Fixes: rpSz7v3yq2u8
Fixes: 72982f8cb5 (avcodec/nvdec: add support for separate reference frame)
Found-by: Pavel Kohout (Aisle Research)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 4c6217477f)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-07-21 22:59:52 +02:00
Pavel Kohout
bd108f4026 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-07-21 22:59:52 +02:00
Pavel Kohout
aba17b5dc3 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-07-21 22:59:52 +02:00
Michael Niedermayer
947c57d9e6 avcodec/mace: reject sample counts that overflow int
Fixes: heap buffer overflow
Fixes: FmXBI2dbgvgD
Fixes: 0eea212943 (Add avcodec_decode_audio4().)
Found-by: Adrian Junge (vurlo)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit aafb5c655e)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-07-21 22:59:52 +02:00
Anxious Koisi
92880ab4a4 avcodec/apac: Check bitstream_size to avoid integer overflow
Found-by: k00shi_
Fixes: OOM
Fixes: poc.c
Fixes: XMkAe1I9uFro
(cherry picked from commit 63958ce2b5)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-07-21 22:59:52 +02:00
Pavel Kohout
c10e7f5dc1 avcodec/adx: sync decoder channel state on NEW_EXTRADATA
Fixes: out of array access
Fixes: heaNtmHvklpe
Fixes: 92396cee60 (avformat: add CRI AAX demuxer)
Found-by: Pavel Kohout (Aisle Research)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 1836ef9684)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-07-21 22:59:51 +02:00
Pavel Kohout
dcf8ce2802 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>
2026-07-21 22:59:51 +02:00
Pavel Kohout
3c441711a3 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>
2026-07-21 22:59:51 +02:00
Michael Niedermayer
385ac2fadc 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>
2026-07-21 22:59:51 +02:00
Pavel Kohout
2ec918330e avfilter/boxblur: reject pixel formats deeper than 16 bits
Fixes: heap buffer overflow
Fixes: CRufFb6TVikL
Fixes: dee7440531 (vf_boxblur: Templatize blur{8,16})
Found-by: Pavel Kohout (Aisle Research)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 0dac41d2e5)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-07-21 22:59:51 +02:00
Thomas Guilbert
c7d69b3a80 Guard lpc methods in flacdsp and add tests
This commit adds additional guards for the RISC-V lpc variants.

It also adds tests to exercise the guarded paths in checkasm/flacdsp.c.

(cherry picked from commit b3fb13e8dd)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-07-21 22:59:50 +02:00
Thomas Guilbert
07af5c70de Guard against loop underflow
This commits adds an early returns if `len <= pred_order` for RISC-V
architectures, matching the logic on other architectures.

(cherry picked from commit f956c41d7b)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-07-21 22:59:50 +02:00
Michael Niedermayer
5464915e69 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-07-21 22:59:50 +02:00
Michael Niedermayer
eaf524a746 avfilter/vf_removelogo: free the whole mask on allocation failure
Found-by: Ao Xijie
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 9a01c1cb6a)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-07-21 22:59:50 +02:00
Michael Niedermayer
4423d1b59e avfilter/af_adeclick: free transform contexts and buffers on error
Found-by: Ao Xijie
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 59a5090070)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-07-21 22:59:50 +02:00
Jeongkeun Kim
83c2e80f80 tests/checkasm/llviddsp: fix add_left_pred_int16 buffer compare size
dst0/dst1 are uint16_t* allocated as width * sizeof(uint16_t), but
the memcmp at the end of check_add_left_pred_16 only compared `width`
bytes — missing the second half of each buffer. Same pattern used
correctly in tests/checkasm/huffyuvdsp.c (memcmp with width * sizeof()).

While at it, fix missing whitespace around & and || on the same line.

Fixes: fbe9148779 ("checkasm/llviddsp : add test for other dsp func")
Signed-off-by: Jeongkeun Kim <variety0724@gmail.com>
(cherry picked from commit 2be6bf5507)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-07-21 22:59:49 +02:00
Michael Niedermayer
f15e730cd2 avformat/iamf_parse: check count_label against the available bytes
Fixes: unbounded allocation / denial of service
Fixes: tP59h4cpaFyg
Fixes: 4ee05182b7 (avformat: Immersive Audio Model and Formats demuxer)
Found-by: Adrian Junge (vurlo)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 86708357d1)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-07-21 22:59:49 +02:00
Umar Pathan
f8d7795dcc avcodec/rasc: Check that 32-bit DLTA accesses stay within the row
Found-by: bikini (github.com/bikini/exploitarium)
Fixes: out of array access
Fixes: rowspill_128x1.avi / gen_rowspill_avi.py
Fixes: xGV79bIb7uAJ
(cherry picked from commit 11ff18a6c8)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-07-21 22:59:49 +02:00
Michael Niedermayer
b76ad17ab4 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-07-21 22:59:49 +02:00
Michael Niedermayer
e41e53e5ae avcodec: Align bayer pixel formats to 2x2
Fixes: out of array access with odd dimensioned bayer
Fixes: fa6F4c0xA8el
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 11afa309fb)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-07-21 22:59:49 +02:00
Michael Niedermayer
a1712ef816 avcodec/ffv1enc: Reject odd dimensions for bayer
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 87bd15dc3c)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-07-21 22:59:49 +02:00
Michael Niedermayer
0511c27041 avcodec/ffv1dec: Reject bayer with unaligned slice coordinates
Bayer was introduced (4f509c9e43) with combined_version 0x4000A, so no real
bayer stream uses the old unaligned coordinates; reject it. Odd picture
dimensions remain valid and are handled by aligning the bayer allocation to
2x2.

Fixes: out of array write
Fixes: fa6F4c0xA8el
Fixes: 4f509c9e43 (ffv1dec: implement Bayer pixel format encoding)
Found-by: Anonymous
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit cc17277c36)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-07-21 22:59:48 +02:00
Michael Niedermayer
21e25bd1ab avcodec/mpeg4videodec: Copy studio_profile in frame-thread context update
Fixes: out of array access
Fixes: poc.m4v / make_poc.py
Fixes: 93KU7grvT7G1
Fixes: f9d3841ae6 (mpeg4video: Add support for MPEG-4 Simple Studio Profile.)
Found-by: VulnForge Security Research Team <haoyuliu@clouditera.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 19035c35fc)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-07-21 22:59:48 +02:00
Jiale Yao
8af6c71d96 avfilter/vf_vif: Fix out of array access with small dimensions
The hand written boundary mirroring reflected an out of range index only
once, which is insufficient when the image dimension is smaller than the
filter half width (filt_w/2 == 8). A 1x1 input made the index reach 8
and -7, reading out of the src[]/temp[] arrays. Use avpriv_mirror(),
which mirrors repeatedly and stays in range for any dimension.

Fixes: out of array access
Fixes: repro.sh
Fixes: HuQn51lLiVJX
Fixes: 38aea9b041 (avfilter: add vif filter)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 56309e476a)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-07-21 22:59:48 +02:00
Marco Reimann
2864ce5e28 avcodec/nellymoserdec: Check block count to avoid integer overflow
Fixes: out of array access
Fixes: nelly.avi / gen_nelly_overflow.py
Fixes: pgc86PfE7ZpA
Fixes: 0eea212943 (Add avcodec_decode_audio4().)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit f9482e1d01)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-07-21 22:59:48 +02:00
Timo Rothenpieler
3abec89a45 avcodec/d3d12va_vp9: check size of frame bitstream against available buffer size
(cherry picked from commit a633df56a4)
2026-07-19 19:43:57 +00:00
Timo Rothenpieler
ae0feeac8d avcodec/d3d12va_vc1: check size of frame bitstream against available buffer size
(cherry picked from commit 1307db3d3c)
2026-07-19 19:43:57 +00:00
Timo Rothenpieler
865374b1ab avcodec/d3d12va_mpeg2: check size of frame bitstream against available buffer size
(cherry picked from commit 26a9f9b3ae)
2026-07-19 19:43:57 +00:00
Timo Rothenpieler
b19b023f2a avcodec/d3d12va_hevc: check size of frame bitstream against available buffer size
(cherry picked from commit fea3f13a1c)
2026-07-19 19:43:57 +00:00
Timo Rothenpieler
3a44bddfb9 avcodec/d3d12va_h264: check size of frame bitstream against available buffer size
(cherry picked from commit 19e81f9260)
2026-07-19 19:43:57 +00:00
Timo Rothenpieler
a90fbb6bc9 avcodec/d3d12va_av1: check slice bitstream size against available buffer size
(cherry picked from commit 7309ad9fd7)
2026-07-19 19:43:56 +00:00
Timo Rothenpieler
60aca6ace7 avcodec/d3d12va_av1: check size of frame bitstream against available buffer size
(cherry picked from commit e1ef95c779)
2026-07-19 19:43:56 +00:00