Commit Graph
128499 Commits
Author SHA1 Message Date
Michael Niedermayer 95c86cb722 fate: let refcmp_metadata take the filter under test
The filter applied to the test source before the comparison becomes an
optional parameter, defaulting to the avgblur used so far.

Assisted-by: Claude
2026-11-05 23:12:03 +00:00
Michael Niedermayer 734743bb89 avfilter/vf_vignette: add a decimated transform option to the wavelet mode
A level works in place on the lowpass lattice of the previous one, so
the mode needs 5 planes instead of 9 + 3 * levels and about an order of
magnitude less computation. Shrinkage is less effective without the
shift invariance of the undecimated transform.

Assisted-by: Claude
2026-11-05 23:12:03 +00:00
Michael Niedermayer 042548c65f avfilter/vf_vignette: slice threading for the wavelet mode
Every pass over a plane, the row and column passes of the transforms as
well as the box filters and the per coefficient operations of the
shrinkage, is split into slices of lines. The output does not depend on
the number of threads.

Assisted-by: Claude
2026-11-05 23:12:03 +00:00
Michael Niedermayer ba940deb9f avfilter/wavelet97: add a decimated transform
Lowpass coefficients are stored at even and highpass ones at odd
positions of the line, so a level works in place on the lattice of the
previous level's lowpass coefficients. Reconstruction from a single
polyphase set needs no averaging, hence no factor 0.5.

Assisted-by: Claude
2026-11-05 23:12:03 +00:00
Michael Niedermayer 205172946b avfilter/wavelet97: expose the per line analysis and synthesis
Lets a filter run the row and column passes over ranges of lines, as
slice threading needs.

Assisted-by: Claude
2026-11-05 23:12:03 +00:00
Michael Niedermayer 5e56cabf83 avfilter/vf_vignette: add a wavelet mode reversing the vignette with noise suppression
Dividing by the attenuation amplifies the noise and the quantization
steps of the dark areas by the same factor. The wavelet mode performs
the division in the pixel domain, then transforms the result and its
per pixel noise variance, propagated through the squared filter taps as
if the samples were uncorrelated, with the undecimated 9/7 wavelet.
Each detail coefficient is Wiener shrunk toward 0 with a signal
variance estimated from a 7x7 box of coefficients at the dilation of
the level, weighted by their precision and counted only when it exceeds
the noise by 3 standard errors of independent coefficients. The lowpass
of the top level averages over large areas and is kept, so the shade of
heavily attenuated areas survives.

Assisted-by: Claude
2026-11-05 23:12:03 +00:00
Michael Niedermayer c1fd7be5c0 avfilter/owdenoise: move the undecimated 9/7 wavelet transform into wavelet97.c
Makes the transform usable by other filters. The analysis filter taps become
a parameter so the same code can also propagate variances with squared taps.

Assisted-by: Claude
2026-11-05 23:12:03 +00:00
Michael Niedermayer 7c7b6befaa fate/ffv1: test the default slice layout of 32bit float frames
The size and checksum of the encoded file pin the slice layout and the
remap coding of a 704x576 float frame, which the 360x288 default slice
limit splits into 2x2 slices.
2026-11-05 23:09:16 +00:00
Michael Niedermayer 6364d8606c avcodec/ffv1enc: reject 32bit float Golomb-Rice slices above 2^18 pixels
The escape code of a Golomb-Rice residual is 12 + bits long and
put_bits() writes at most 31 bits, so bits must stay below 20. The RCT
planes of remapped 32bit floats need log2 of the summed remap counts of
two planes, which a slice of at most 1<<18 pixels keeps within 19 bits.
The default slice size of 360x288 is within that, larger slices requested
with -slices were written with escape codes longer than put_bits()
supports. The assertion on k follows the same limit.
2026-11-05 23:09:16 +00:00
Michael Niedermayer 60d62ca406 avcodec/ffv1dec: clamp k in get_vlc_symbol() at 20 instead of bits
Add a FATE test with such planes.
2026-11-05 23:09:16 +00:00
Michael Niedermayer bd6e6f638e avcodec/golomb: read Golomb-Rice codes of up to 32 bits in get_ur_golomb()
Add a FATE test that codes such a residual at every bit offset.
2026-11-05 23:09:16 +00:00
Michael Niedermayer 507e9ad286 avcodec/vvc/dec: require all slices of a frame to use the same PH and PPS
The testcases reproduce since b0c77e5a12.

Fixes: out of array read
Fixes: fAak9zecyttL/testcase/poc.vvc
Fixes: fAak9zecyttL/testcase/poc-entry-points.vvc
Fixes: fAak9zecyttL
Found-by: mzfr <security@mzfr.me>
2026-11-05 23:04:20 +00:00
Michael Niedermayer 2c515eea07 avcodec/cbs_sei: clear the message slot handed out by ff_cbs_sei_list_add()
Fixes: heap-use-after-free
Fixes: YtyT0QH1InrQ
Fixes: ANT-2026-13DK7NZD
Fixes: poc.264
Found-by: Claude and Ada Logics

Use after free Replicated through UnModified FFmpeg with ASAN
2026-11-05 23:03:11 +00:00
Michael Niedermayer 3092ee5a9c avfilter/vf_tonemap: pass the alpha row width, not the linesize, to av_image_copy_plane()
Fixes: negative-size-param
Fixes: assertion failure
Fixes: wzomtdUBffdP
Fixes: ANT-2026-G2YFQ5N2
Fixes: poc.exr
Found-by: Claude and Ada Logics

Negative size memcpy and assertion failure Replicated through UnModified FFmpeg with ASAN
2026-11-05 23:03:11 +00:00
Michael Niedermayer f6d70de099 avcodec/huffyuvdec: budget 33 bits per sample when choosing the unchecked 16 bit loop
Fixes: heap-buffer-overflow (read)
Fixes: BIqbuSbTJqAH
Fixes: ANT-2026-V2EPGE9M
Fixes: poc.avi
Found-by: Claude and Ada Logics

Out of array read Replicated through UnModified FFmpeg with ASAN
2026-11-05 23:03:11 +00:00
Michael Niedermayer 1436f56075 avcodec/aacsbr: turn SBR off when the USAC SBR data cannot be parsed
Fixes: heap-buffer-overflow (write)
Fixes: GITTfi6VsK4u
Fixes: ANT-2026-5KX1BXM6
Fixes: poc.flv
Found-by: Claude and Ada Logics

Out of array write Replicated through UnModified FFmpeg with ASAN
2026-11-05 23:03:11 +00:00
Michael Niedermayer 19ed6f17d3 avutil/frame: compute the cropping offsets as ptrdiff_t
Found during triage/review of the security report NzELYSvufGfQ
(ANT-2026-324B3XNF), which does not report this.

Fixes: pointer overflow
Pointer overflow Replicated through UnModified FFmpeg with UBSAN
2026-11-05 23:03:11 +00:00
Michael Niedermayer 4968cc472b avcodec/mjpegdec: set the AVID frame height and cropping before flipping
Fixes: heap-buffer-overflow (read)
Fixes: NzELYSvufGfQ
Fixes: ANT-2026-324B3XNF
Fixes: ant-324b3xnf-avrn-64x32-flipped.avi
Found-by: Claude and Ada Logics

Out of array read Replicated through UnModified FFmpeg with ASAN
2026-11-05 23:03:11 +00:00
Michael Niedermayer a82e676a82 avcodec/vvc/ps: do not truncate the virtual boundary position limit to 16 bits
Fixes: negative-size-param
Fixes: left shift of negative value
Fixes: 0IMcpiRlVAb5
Fixes: ANT-2026-QY2HYS5A
Fixes: poc.mkv
Found-by: Claude and Ada Logics

Negative size memcpy Replicated through UnModified FFmpeg with ASAN and UBSAN
2026-11-05 23:03:11 +00:00
Michael Niedermayer 67f9665f8e avcodec/cbs_h266: reject SPS virtual boundaries when the resolution may change
Fixes: negative-size-param
Fixes: left shift of negative value
Fixes: 0IMcpiRlVAb5
Fixes: ANT-2026-QY2HYS5A
Fixes: poc.mkv
Found-by: Claude and Ada Logics

Negative size memcpy Replicated through UnModified FFmpeg with ASAN and UBSAN
2026-11-05 23:03:11 +00:00
Michael Niedermayer 20b8812f5c avcodec/cbs_h266: reject an empty SPS conformance window
Fixes: heap-buffer-overflow (read)
Fixes: q0RFgfMenefI
Fixes: ANT-2026-HRT03RV0
Fixes: vvc-subpic-tiles.mkv
Found-by: Claude and Ada Logics

Out of array read Replicated through UnModified FFmpeg with ASAN
2026-11-05 23:03:11 +00:00
Michael Niedermayer a10c197f1e avfilter/vf_median: reject widths whose fine histogram size overflows an int
Fixes: heap-buffer-overflow (read and write)
Fixes: signed integer overflow
Fixes: IhY7QcsV5nva
Fixes: ANT-2026-RYWQTXHH
Fixes: poc-median-65600x4.pgm
Found-by: Claude and Ada Logics

Out of array access Replicated through UnModified FFmpeg with ASAN and UBSAN
2026-11-05 23:03:11 +00:00
Michael Niedermayer 12e5d4ec98 avcodec/lcldec: check the packet size before reading the ZLIB multithread header
Fixes: heap-buffer-overflow (read)
Fixes: G8jPOZLbzYtj
Fixes: ANT-2026-22YEN9NA
Fixes: lcl-zlib-mt-shortlace.mkv
Found-by: Claude and Ada Logics

Out of array read Replicated through UnModified FFmpeg with ASAN
2026-11-05 23:03:11 +00:00
Michael Niedermayer 3c9ed5305c tests/fate: cover audio encoder boundary cases
Exercise the short DVD PCM tail, one-sample TTA frame, early RoQ flush and mono Microsoft ADPCM trellis paths fixed by PR 25694. Existing audio round trips do not cover these boundaries.

Generate input with sine and atrim, and compare packets through the framecrc muxer. No new samples or bitstream generator are needed.

Assisted-by: Fairy
2026-11-05 23:01:56 +00:00
Michael Niedermayer 90f5e61a1d avcodec/vorbis_parser: parse the extradata only once
Fixes: Timeout
Fixes: nsq7AyzgMo4U
Fixes: AISLE-2026-0150-00507
Timeout Replicated through UnModified FFmpeg

Found-by: Joshua Rogers (AISLE)
2026-11-05 23:01:56 +00:00
Michael Niedermayer e621da8ecd avcodec/wavpackenc: compute the default block size in 64 bit
Fixes: signed integer overflow
Fixes: infinite loop
Fixes: dVqGncTUAyg9
Fixes: AISLE-2026-0150-00591
Signed integer overflow and infinite loop Replicated through API with UBSAN

Found-by: Joshua Rogers (AISLE)
2026-11-05 23:01:56 +00:00
Michael Niedermayer fb13409aaf avcodec/adpcmenc: encode all samples of a mono ADPCM_MS block with trellis
Fixes: use of uninitialized memory
Fixes: 98u4sU59NEf4
Fixes: AISLE-2026-0150-00113
Use of uninitialized memory Replicated through UnModified FFmpeg with Valgrind

Found-by: Joshua Rogers (AISLE)
2026-11-05 23:01:56 +00:00
Michael Niedermayer f71410e028 avcodec/roqaudioenc: encode the buffered samples when flushed early
Encode the buffered samples once and return no packet when the buffer
is empty.

Fixes: use of uninitialized memory
Fixes: X43TLCpjYK88
Fixes: AISLE-2026-0150-00397
Use of uninitialized memory Replicated through UnModified FFmpeg with Valgrind

Found-by: Joshua Rogers (AISLE)
The fix was suggested in the report.
2026-11-05 23:01:56 +00:00
Michael Niedermayer 29a629e788 avcodec/ttaenc: check the packet space for each sample and the CRC
Fixes: Assertion failure
Fixes: bAfKKmQm4ZDe
Fixes: AISLE-2026-0150-00078
Assertion failure Replicated through UnModified FFmpeg

Found-by: Joshua Rogers (AISLE)
2026-11-05 23:01:56 +00:00
Michael Niedermayer cfe6a6cd7d avcodec/pcm-dvdenc: do not encode a frame with fewer samples than a block
24 bit samples are stored in blocks of samples_per_block samples
and the sample count of a frame is rounded down to whole blocks. A last
frame with fewer samples than a block gives zero blocks, the do/while
loops still run and read past the frame until the block count wraps.

Return no packet for such a frame.

Fixes: out of array read
Fixes: ZplUzGvg2XP9
Fixes: AISLE-2026-0150-00112
Out of array read Replicated through UnModified FFmpeg with ASAN

Found-by: Joshua Rogers (AISLE)
2026-11-05 23:01:56 +00:00
Michael Niedermayer f1205ee018 avcodec/bitpacked: check the packet size before using it as a UYVY422 frame
Fixes: out of array read
Fixes: 2dyV2eNJkKBV
Fixes: AISLE-2026-0150-00092
Out of array read Replicated through API with ASAN

Found-by: Joshua Rogers (AISLE)
2026-11-05 23:01:14 +00:00
Michael Niedermayer ad7ce15a51 avcodec/psd: free the RLE buffer when the frame allocation fails
This is not a security issue: the leak needs the frame allocation to
fail.

Fixes: memleak
Fixes: 9UXawhjlJguX
Fixes: AISLE-2026-0150-00349
Memory leak Replicated through API with LSAN

Found-by: Joshua Rogers (AISLE)
2026-11-05 23:01:14 +00:00
Michael Niedermayer aa4b80b54e avcodec/psd: reject an uncompressed image size above INT_MAX
Fixes: out of array write
Fixes: MymIHidCHVJu
Fixes: AISLE-2026-0150-00348
Out of array write Replicated through UnModified FFmpeg (32-bit) with ASAN

Found-by: Joshua Rogers (AISLE)
2026-11-05 23:01:14 +00:00
Michael Niedermayer 62c308e041 avcodec/hap: bound the sum of the uncompressed chunk sizes
Fixes: out of array write
Fixes: fglxAK3pz5sP
Fixes: AISLE-2026-0150-00462
Out of array write Replicated through UnModified FFmpeg (32-bit) with ASAN

Found-by: Joshua Rogers (AISLE)
2026-11-05 23:01:14 +00:00
Michael Niedermayer 27f612b306 avcodec/flicvideo: bound pixel writes at both ends of the frame storage
Fixes: out of array write
Fixes: GGsIHTeUwf0U
Fixes: AISLE-2026-0150-00642
Out of array write Replicated through API with ASAN

Found-by: Joshua Rogers (AISLE)
2026-11-05 23:01:14 +00:00
Michael Niedermayer 515dcad73d avcodec/adxdec: validate the sample rate before changing the channel layout
Null pointer dereference Replicated through UnModified FFmpeg with ASAN

Fixes: null pointer dereference
Fixes: kmrMEk1So1o7
Fixes: AISLE-2026-0150-00566

Found-by: Joshua Rogers (AISLE)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-11-05 22:59:52 +00:00
Michael Niedermayer db98784a72 avcodec/mlz: reject string codes beyond the dictionary
Use of uninitialized memory Replicated through UnModified FFmpeg with MSAN
Use of uninitialized memory Replicated through API with MSAN

Fixes: use of uninitialized memory
Fixes: ln0NC22XPto3
Fixes: AISLE-2026-0150-00420

Found-by: Joshua Rogers (AISLE)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-11-05 22:59:52 +00:00
Michael Niedermayer 01e1bb1261 avcodec/takdec: require the multichannel channel list to cover all channels
Use of uninitialized memory Replicated through UnModified FFmpeg with MSAN

Fixes: use of uninitialized memory
Fixes: aWhU4kuts0tn
Fixes: AISLE-2026-0150-00040

Found-by: Joshua Rogers (AISLE)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-11-05 22:59:52 +00:00
Michael Niedermayer 968e9e948e avcodec/apedec: reject legacy frames with more than 73728 samples
Excessive memory allocation (peak RSS 2.58 GB from a 52 byte file)
Replicated through UnModified FFmpeg with ASAN

Fixes: out of memory
Fixes: 2cNjGsVIMOVX
Fixes: AISLE-2026-0150-00053

Found-by: Joshua Rogers (AISLE)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-11-05 22:59:52 +00:00
Michael Niedermayer 1f4b2e22cf avformat/sbgdec: bound the default frame size
Excessive memory allocation (peak RSS 2.3 GB from a 69 byte script)
Replicated through UnModified FFmpeg with ASAN

Fixes: out of memory
Fixes: 6m4Av2yQJEhE
Fixes: AISLE-2026-0150-00550

Found-by: Joshua Rogers (AISLE)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-11-05 22:59:52 +00:00
Michael Niedermayer 6ecaddb9c1 avcodec/interplayacm: reject blocks larger than 1M samples
The limit is libacm's MAX_BLOCK_LEN (1024 * 1024 samples, decode.c);
libacm is the decoder this one derives from and is what the games'
modding tools use, so no file decodable by it is rejected. Real files
from Baldur's Gate, Baldur's Gate II, Icewind Dale, Icewind Dale II and
Planescape: Torment use level 7 or 8 with 16 rows, blocks of 2048 or
4096 samples, and the snd2acm / DLTCEP encoder defaults to level 7 with
16 rows, 256 times below the limit.

Excessive memory allocation (peak RSS 944 MB from a 78 byte file)
Replicated through UnModified FFmpeg with ASAN

Fixes: out of memory
Fixes: fi1TMFhPx2mP
Fixes: AISLE-2026-0150-00274

Found-by: Joshua Rogers (AISLE)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-11-05 22:59:52 +00:00
Michael Niedermayer 201a2994d3 avcodec/tiertexseqv: keep the block pointer within the block
A code table whose lengths add up to more than the block size advanced
dst and dst_size past the end of the block. The copies were already
limited to the block, so no memory was written out of bounds, but forming
a pointer beyond one past the end of an array is undefined behaviour.

This is not a security issue.
2026-11-05 22:51:06 +00:00
Michael Niedermayer acbf987d7b avcodec/tiertexseqv: reject RLE code tables that do not cover the block
Found during triage of the security report V9Z2ZdGQsUo6

Fixes: V9Z2ZdGQsUo6
Fixes: use of uninitialized memory
Use of uninitialized memory Replicated through UnModified FFmpeg with MSAN
2026-11-05 22:51:06 +00:00
Michael Niedermayer c896bbb245 avcodec/tiertexseqv: check the RLE block unpacking before copying the block
Fixes: V9Z2ZdGQsUo6
Fixes: AISLE-2026-0150-00048
Fixes: use of uninitialized memory
Use of uninitialized memory Replicated through UnModified FFmpeg with MSAN

Found-by: Joshua Rogers (AISLE)
2026-11-05 22:51:06 +00:00
Michael Niedermayer c05d46ea29 avcodec/exr: compute the tile count in 64 bits
Fixes: ZF6qKuDyIHUD
Fixes: AISLE-2026-0150-00476
Fixes: disclosure of previous frame content
Disclosure of previous frame content Replicated through UnModified FFmpeg

Found-by: Joshua Rogers (AISLE)
2026-11-05 22:51:06 +00:00
Michael Niedermayer 01a395b935 avcodec/rawdec: require a full row of input per line for 1 to 8 bits per pixel
Fixes: Wq9WI8WzfMaj
Fixes: AISLE-2026-0150-00106
Fixes: use of uninitialized memory
Use of uninitialized memory Replicated through UnModified FFmpeg with MSAN

Found-by: Joshua Rogers (AISLE)
2026-11-05 22:51:06 +00:00
Michael Niedermayer ac0106851a avcodec/c93: fail on truncated color tables
Fixes: Ao8AXNwB2RlH
Fixes: AISLE-2026-0150-00011
Fixes: use of uninitialized memory
Use of uninitialized memory Replicated through UnModified FFmpeg with MSAN

Found-by: Joshua Rogers (AISLE)
2026-11-05 22:51:06 +00:00
Michael Niedermayer 92b318e0b3 avcodec/webp: reject uncompressed alpha chunks shorter than the image
Fixes: 8VUuZb6oh1t5
Fixes: AISLE-2026-0150-00187
Fixes: disclosure of previous frame content
Disclosure of previous frame content Replicated through UnModified FFmpeg
(image sequence of 40 lossy images with alpha 0xAA followed by one with a
4 byte uncompressed ALPH chunk, the alpha plane of the last frame shows
0xAA)

Found-by: Joshua Rogers (AISLE)
2026-11-05 22:51:06 +00:00
Michael Niedermayer e578999fa3 avcodec/gemdec: clear the row buffer before decoding
Fixes: pqQviaXoqzKF
Fixes: AISLE-2026-0150-00236
Fixes: use of uninitialized memory
Use of uninitialized memory Replicated through UnModified FFmpeg with MSAN

Found-by: Joshua Rogers (AISLE)
2026-11-05 22:51:06 +00:00
Jeongkeun Kim 8105ae2afe avcodec/aarch64: add NEON lfe_fir_fixed for DCA DSP
Add a NEON implementation of the fixed-point DCA LFE FIR interpolation
filter.

Each vector lane holds one of four consecutive LFE samples, so the
filter coefficients are used as by-element multipliers and can be
loaded contiguously without any permutes. One load of c[8j..8j+7] and
c[248-8j..255-8j] covers outputs j, 32+j, 31-j and 63-j. The 8-tap
sums are accumulated in 64 bits with SMULL/SMLAL, rounded with SQRSHRN,
clipped to 23 bits with SQSHL/SSHR and written with ST2 lane stores.

Recent clang versions auto-vectorize the C version, so the speedup
depends a lot on the compiler. On Neoverse-N1 (64 LFE samples):

  C compiler   speedup
  clang 14     4.84x
  gcc 11       1.75x
  clang 20     1.21x
  clang 22     1.21x

Signed-off-by: Jeongkeun Kim <variety0724@gmail.com>
2026-11-05 21:16:11 +00:00