Commit Graph

123519 Commits

Author SHA1 Message Date
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 7aecd49777 avfilter/estdif: avoid signed overflow in slice boundary calculation
deinterlace_slice() computed per-thread row boundaries with int
multiplication height * (jobnr + 1). With a tall frame and many filter
threads the product overflows signed int before the division by nb_jobs.

Use int64_t for the intermediate product before converting back to int
row indices.

Found-by: Kery (Qi Kery <qikeyu2001@outlook.com>)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 200e0cba67)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:41:08 +02:00
Michael Niedermayer 352f6dfbe1 swscale: support sliced input with cascaded scaling contexts
Previously scale_cascaded() assumed the whole source frame arrived in a
single sws_scale() call, and the dispatcher only routed full-frame calls
to it. A partial input slice fell through to ff_swscale() on the parent
dispatcher context, whose scaler state (c->desc) is never initialized in
cascade mode, causing a NULL dereference / crash.

Top-down sliced output is bit-exact with full-frame scaling; bottom-up
matches swscale's pre-existing (non-cascade) slice behaviour for
subsampled intermediate formats.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 10f2abc41f)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:41:08 +02: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
James Almer 84087839af avcodec/cbs_h266_syntax_template: reject subpic info with res_change_in_clvs
Found-by: Anthony Hurtado
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 0cf9169c85)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:41:07 +02:00
Michael Niedermayer 4b32214900 avcodec/misc4: Check nb channels
Found-by: Forgejo Fairy
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 7b717fe50d)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:41:07 +02:00
Michael Niedermayer 52af067ac2 avcodec/rv10, rv34: check init_get_bits8() before RealVideo bit access
Found-by: Samarth Kumbla <samarthk@cantina.security>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 0c662529f6)
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 a4152636b8 avcodec/agm: validate actual src_y against prev plane in decode_inter_plane
Found-by: Anthropic agents; validated and reported by Ada Logics.

Signed-off-by: David Korczynski <david@adalogics.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 4527854281)
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
Zhen Yan ee25d8ec07 fftools/ffmpeg_dec: deep-copy subtitle_header to fix use-after-free
Found-by: Zhen Yan
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit fa391e90fb)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:41:06 +02:00
Michael Niedermayer e3ce59ba68 avcodec/hevc/ps: Check window parameters
Fixes: signed integer overflow: -1094995529 * 2 cannot be represented in type 'int'
Fixes: 484567435/clusterfuzz-testcase-minimized-ffmpeg_dem_HXVS_fuzzer-5628836988649472

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 82f097c825)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:41:06 +02:00
Michael Niedermayer bcee8b9f0b avcodec/hevc/ps: Factor window reading out
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 8c868a1fd2)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:41:05 +02:00
David Korczynski e3d0fca1bb avcodec/truespeech: reject iterations count whose * 240 product overflows 32-bit
Found-by: Anthropic agents; validated and reported by Ada Logics.
Signed-off-by: David Korczynski <david@adalogics.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d30dead35e)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:41:05 +02:00
Robert Nagy 101bb4c249 libavcodec/options_table: gamma22 and gamma28 aliases
(cherry picked from commit 06e11c87c6)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:41:05 +02:00
David Korczynski 797cbc7413 avcodec/on2avc: reject subframe count whose * SUBFRAME_SIZE product overflows 32-bit
Found-by: Anthropic agents; validated and reported by Ada Logics.
Signed-off-by: David Korczynski <david@adalogics.com>
(cherry picked from commit 331b3e9dea)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:41:05 +02:00
haoyuLiu 3a9a2f13de avfilter/zmq: initialize send_buf before shared cleanup on parse failure
Found-by: VulnForge Security Research Team
Reported-by: Cloud-LHY <haoyuliu@clouditera.com>
(cherry picked from commit 6028720d70)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:41:05 +02:00
Michael Niedermayer 849ed5f176 avcodec/adpcm: fix signed integer overflow in get_nb_samples()
Fixes: signed integer overflow: 314572800 * 8 cannot be represented in type 'int'

Tighten the guard to INT_MAX/14, which covers the largest expansion
factor used in the function currently.

Found-by: Jiale Yao <19888972804@163.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 04e2341056)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:41:05 +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
David Korczynski 417061746d avcodec/fastaudio: reject subframes count whose * 256 product overflows 32-bit
fastaudio_decode() computes
    subframes = pkt->size / (40 * channels);
    frame->nb_samples = subframes * 256;
both as 32-bit signed multiplications. When pkt->size is large enough
to make subframes >= 2^24, the second multiplication overflows the
signed int range and frame->nb_samples wraps to a small value.
ff_get_buffer() then sizes the audio plane for that wrapped sample
count, while the decoder loop at line 152 still iterates the full
(unwrapped) subframes count, performing a 1024-byte memcpy per
subframe per channel. The 27th iteration (or first iteration with
nb_samples=0) writes one byte past the per-plane allocation,
yielding the ASan heap-buffer-overflow WRITE at libavcodec/fastaudio
.c:171 reported as ANT-2026-03891.

Reject the subframes value whose *256 product would overflow before
performing the multiplication. The bound INT_MAX / 256 (= 8388607)
keeps the existing two's-complement semantics of every reachable
input and rejects only the configurations that would have wrapped.

Reproducer: a crafted AVI declaring one mono audio chunk of
671_088_680 bytes (sparse) with the decoder forced via
'ffmpeg -c:a fastaudio -i evil.avi'.

Found-by: Anthropic agents; validated and reported by Ada Logics.

Signed-off-by: David Korczynski <david@adalogics.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 1e9984772b)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:41:04 +02:00
Michael Niedermayer 31be6491d2 avcodec/vc2enc_dwt: avoid signed overflow in the 9/7 DWT lifting
Fixes: 490488944/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC2_fuzzer-5310290362433536
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 5f91556215)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:41:04 +02:00
Michael Niedermayer cb55da3768 avcodec/vc2enc_dwt: avoid signed overflow in the 5/3 and Haar DWT
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 7c7ca349bc)
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 d5ac401940 avcodec/mjpegdec: require progress in AVRn interlaced field loop
Fixes: Timeout
Fixes: 500554625/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MEDIA100_fuzzer-5094103347167232
Fixes: 511253447/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SMVJPEG_fuzzer-5780722463080448
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 b355200263)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:41:03 +02:00
Michael Niedermayer 08597a382e avcodec/mwsc: do not dereference a missing reference frame
Fixes: 493841393/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MWSC_fuzzer-5079884677578752
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 ba825ce85f)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:41:03 +02:00
Michael Niedermayer b77508937f avcodec/misc4: reject invalid sample rate
Fixes: AVERROR_BUG

Fixes: 493055111/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MISC4_fuzzer-5752676962074624
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 32eb07bb83)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:41:03 +02:00
Michael Niedermayer 9006342109 swscale/output: avoid signed overflow in yuv2rgba64_1 alpha
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 0ab097fb34)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:41:03 +02:00
Michael Niedermayer 28c0fda2cd swscale/output: avoid signed overflow in yuv2rgba64_full_1 alpha
Fixes: 493055112/clusterfuzz-testcase-minimized-ffmpeg_SWS_fuzzer-5823995319746560
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 ad84fc9b7d)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:41:03 +02:00
Michael Niedermayer 6a25c9adfc tools/target_dem_fuzzer: do not exit on io_buffer allocation failure
Failure to allocate a randomly sized buffer should not count as a anomaly in the fuzzer
there is nothing to fix in that case

Fixes: 490112574/clusterfuzz-testcase-minimized-ffmpeg_dem_TMV_fuzzer-6600485921685504
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 2cce6ad030)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:41:03 +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 5da47b2752 swscale/rgb2rgb_template: use unsigned for <<24
Found-by: jiale yao
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit dbe78ffdb8)
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
Anthony Hurtado b7f3a666ca avcodec/diracdec: fix heap buffer overflow in edge_emu_buffer
Fixes: poc_dirac_v2_*
(cherry picked from commit 495b402f27)
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
Michael Niedermayer ea01723885 avcodec/tdsc: propagate max_pixels to the JPEG tile decoder
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 47f3996bdd)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:41:01 +02:00
Michael Niedermayer 36beb07e57 avcodec/imm5: propagate max_pixels to the H264/HEVC sub-decoders
Fixes: 501794495/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IMM5_fuzzer-5192457796255744
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 c1d3e8c46f)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:41:01 +02:00
Michael Niedermayer e569af76bc avcodec/cri: propagate max_pixels to the JPEG tile decoder
Fixes: 489941776/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CRI_fuzzer-4845035614175232
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 cdba2d76dc)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:41:01 +02:00
Michael Niedermayer 5ff3913787 avcodec/jpeglsdec: only apply color transform to decoded rows
Fixes: Timeout
Fixes: 503996733/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MJPEG_DEC_fuzzer-4948713016721408
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 3669a742dd)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:41:01 +02:00
David Korczynski cbc62ea2c8 avcodec/adpcm: require block_align to be a multiple of channels in ADPCM_PSXC init
The ADPCM_PSXC block loop in adpcm_decode_frame() (libavcodec/adpcm.c:
2770) iterates 'block < avpkt->size / block_align' times and, for
each block, consumes
    channels * (1 + (block_align - 1) / channels)
input bytes via the *unchecked* bytestream2_get_byteu() reader. The
loop divides avpkt->size by block_align, so the loop bound is sound
only when the per-block consumption equals block_align — i.e. when
block_align is an exact multiple of channels. For any other
combination (e.g. block_align=9 with channels=8), each block consumes
more than block_align bytes; iterating avpkt->size/block_align
blocks then walks the input bytestream past avpkt->data +
avpkt->size, producing the heap-buffer-overflow READ at
libavcodec/bytestream.h:99 reported as ANT-2026-04052.

adpcm_decode_init() previously only enforced 'channels > 0' and
'block_align > 0' for PSXC. Tighten the init check to additionally
require 'block_align % channels == 0', which is the precise
invariant the decode loop depends on.

Reproducer: a crafted WAV header declaring channels=8, block_align=9
with the decoder forced via 'ffmpeg -c:a adpcm_psxc -i evil.wav'.

Found-by: Anthropic agents; validated and reported by Ada Logics.

Signed-off-by: David Korczynski <david@adalogics.com>
(cherry picked from commit 6d8f7882ae)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:41:01 +02:00
jiale yao 9906b38d1d avfilter/avf_showcwt: fix out-of-bounds read in du scroll
Fixes: out of array access
Found-by: jiale yao
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit e8031e5b9a)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:41:00 +02:00
Michael Niedermayer 41e1b6d817 avfilter/f_ebur128: avoid signed-int wrap when sizing per-channel cache
Fixes: integer overflow
Fixes: out of array access

Found-by: Claude (Anthropic), reported by Omkhar Arasaratnam <omkhar@linkedin.com>.
(cherry picked from commit 537e87e3c2)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:41:00 +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 a153f5f2fa avcodec/aac/aacdec_usac: reject explicit usacSamplingFrequency of 0
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 263374ac7d)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:41:00 +02:00
Michael Niedermayer a8a7a2afa1 avcodec/aac/aacdec_usac: avoid signed overflow in decode_tsd
decode_tsd() computes the binomial coefficient c = C(k, p) incrementally.
this commit makes it less overflow prone

Fixes: 515703905/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_DEC_fuzzer-4890954254581760
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 69c9f1158c)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:41:00 +02:00
Michael Niedermayer 2b81143984 avcodec/aac/aacdec: reject decoded frame without a valid sample rate
Later code will turn this into AVERROR_BUG

When returning sample_rate == 0 samples is considered a bug, we have no
nice choice but to error out cleanly

Fixes: assertion failure
Fixes: ffmpeg_AV_CODEC_ID_AAC_DEC_fuzzer crash-0a86d46fef2442b222ee34403c21f7f582ffccb0
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit e711e60827)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:40:59 +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
James Almer b3a15b4ee1 avcodec/cbs_h266_syntax_template: Fix pps_exp_slice_height_in_ctus_minus1 range
Found-by: Claude (Anthropic). Human-verified and reported by Omkhar Arasaratnam <omkhar@linkedin.com>.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit bf608f16fd)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:40:59 +02:00
Michael Niedermayer 2834b438ec avfilter/vf_scale: split rational multiply
Fixes: integer overflow in SAR
Found-by: jiale yao
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 97ea5da419)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:40:59 +02:00