Commit Graph
53849 Commits
Author SHA1 Message Date
Michael Niedermayer 38b88335f9 Bump for 8.1.2
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-17 04:33:35 +02:00
Bogdan LismanandMichael Niedermayer f7bbcb91b7 avcodec/snowenc: fix SIGFPE in get_dc() when a block lies outside the plane
get_dc() divides the accumulated, OBMC-weighted DC by aa, the sum of the
squared OBMC weights taken over the in-plane pixels.  When an OBMC block
falls entirely outside the plane - e.g. a tiny chroma plane after mcdeint
splits a frame into fields - no pixel contributes, aa stays 0 and the
ROUNDED_DIV() divides by zero (SIGFPE).  ab is 0 in exactly the same case,
so the result degenerates to 0; return it directly.

Reproducible with the GPL mcdeint filter in slow/extra_slow mode, e.g.

    ffmpeg -f lavfi -i testsrc=s=128x2 -vf mcdeint=mode=slow -f null -

Add a self-contained lavfi-based FATE regression test for the slow mode,
which previously crashed and is therefore not covered by the existing
sample-based fast/medium tests.

Fixes trac ticket #7779.

Signed-off-by: Bogdan Lisman <bogdan@pydevsolutions.com>
(cherry picked from commit a62d996927)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-17 04:08:30 +02:00
Michael Niedermayer 8c2e27e7bc avcodec/snowenc: fix out-of-bounds OBMC read in get_dc() for narrow planes
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 30c6667dad)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-17 04:08:30 +02:00
Michael Niedermayer ad3e1ef726 libavcodec/jpeg2000htdec: remove trailing whitespace
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-16 19:49:27 +02:00
Leo IzenandMichael Niedermayer 3c0b18a3a6 avcodec/libjxlenc: check orientation tag metadata before reading
We need to check that entry->count is nonzero and that entry->type is
AV_TIFF_SHORT before reading from the buffer, in case a maliciously
constructed IFD uses a zero-count or an unusual type (e.g. IFD) for it.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
(cherry picked from commit 05b5add006)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-16 06:05:42 +02:00
Osamu WatanabeandMichael Niedermayer b94b712611 avcodec/jpeg2000: Fix undefined behavior on ROI shift-up
(cherry picked from commit 8490363634)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-16 05:49:18 +02:00
LynneandMichael Niedermayer e33bbfbee6 aacdec_usac_mps212: reject reserved freq_res value
(cherry picked from commit 7c79c79a50)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-16 05:45:35 +02:00
Gil PortnoyandMichael Niedermayer f9d7f434c0 avcodec/aac/aacdec_usac_mps212: Off-by-one bounds check in ff_aac_ec_data_deci()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>

No testcase, the check seems redundant

(cherry picked from commit 8b9851b005)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-16 05:41:47 +02:00
Bogdan LismanandMichael Niedermayer 223764a43e avcodec/snowenc: fix out-of-bounds memcpy in get_block_rd() for narrow planes
For an edge block, get_block_rd() copies the full-OBMC-weight central
region directly from cur[] into the reconstruction.  It moved one
boundary to block_w/block_h but overwrote the in-plane clip (x0/x1/y0/y1
computed earlier from the plane size) instead of intersecting with it.
When a plane is narrower than block_w - e.g. a tiny field/chroma plane
produced by the mcdeint filter - the right-edge case left x0 = block_w
while x1 stayed clipped to w - sx < block_w, so x1 - x0 became negative
and was passed to memcpy() as a huge size_t, crashing with SIGSEGV.

Intersect the moved boundaries with the existing clip so the copy region
stays inside the plane and the memcpy length can never be negative.

Reproducible with the GPL mcdeint filter in slow/extra_slow mode, e.g.

    ffmpeg -f lavfi -i testsrc=s=5x32 -vf mcdeint=mode=slow -f null -

This is a separate crash from the get_dc() SIGFPE (ticket #7779) reached
through the same iterative_me() path.  Add a lavfi-based FATE regression
test.

Signed-off-by: Bogdan Lisman <bogdan@pydevsolutions.com>
(cherry picked from commit 1168447626)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-15 23:57:25 +02:00
Michael Niedermayer b9dc787d28 avcodec/cbs_av1_syntax_template: reset seen_frame_header on sequence
headers

With this change CBS and the decoder appear to be in sync.

Fixes: division by 0

Fixes: 501794431/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AV1_fuzzer-4792576644546560
Fixes: 501898692/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AV1_fuzzer-4772278394224640
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 fd290e2fcd)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-15 23:57:24 +02:00
Michael Niedermayer 874de02d87 avcodec/sanm: reject codec37 frames taller than the allocated buffer
No testcase

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit ab5043f055)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-15 23:57:22 +02:00
Michael Niedermayer 79b1d1e1aa avcodec/sanm: reject codec47 frames taller than the allocated buffer
Fixes: 513469519/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SANM_fuzzer-5024854725427200
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 b2695bcbb3)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-15 23:57:22 +02:00
James AlmerandMichael Niedermayer 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
David KorczynskiandMichael Niedermayer 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
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 KorczynskiandMichael Niedermayer 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 NagyandMichael Niedermayer 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 KorczynskiandMichael Niedermayer 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
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
David KorczynskiandMichael Niedermayer 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 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
Anthony HurtadoandMichael Niedermayer 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 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 KorczynskiandMichael Niedermayer 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
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
James AlmerandMichael Niedermayer 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 532063e7ff avcodec/bsf/dts2pts: fix binary tree invariant violation on selective dec_poc
Modifying the keys of a sorted structure, be that a tree or other
can lead to changes in the ordering and undefined behavior.
It can also lead to collisions with existing keys.

All these cases need to be handled unless there is a bug elsewhere
that would prevent them.

Fixes: out of array access
Fixes: 504281984/clusterfuzz-testcase-minimized-ffmpeg_BSF_DTS2PTS_fuzzer-6032368162111488

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 054dffd133)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:40:59 +02:00
David KorczynskiandMichael Niedermayer 0bbf29dee3 avcodec/cook: bound subpacket channel sum against channel count
Fixes: out of array read
Fixes: evil.rm

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 1152139b48)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:40:57 +02:00
Michael Niedermayer af81aaae76 avcodec/apv_decode: avoid using apv_cbc
Fixes: out of array access
Fixes: evil.apv

Found-by: Claude (Anthropic). Human-verified and reported by Omkhar Arasaratnam <omkhar@linkedin.com>. on 05-20
Found-by: Anthropic agents; validated and reported by Ada Logics. on 05-26
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 7a2424eb43)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:40:57 +02:00
Michael Niedermayer 27766a8f74 avcodec/jpeg2000dec: Clear header derived variables
Fixes: NULL pointer dereference

Found-by: Oguzhan Akkaya with AFL++ fuzzing (May 2026)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 6631bbc5d4)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:40:56 +02:00
Michael Niedermayer 8b45f41791 avcodec/bsf/smpte436m_to_eia608: properly frees stuff on errors in ff_smpte436m_to_eia608_filter()
Fixes: memleaks
Fixes: 501913473/clusterfuzz-testcase-minimized-ffmpeg_BSF_SMPTE436M_TO_EIA608_fuzzer-5607133705207808

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 0834dbed1c)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:40:56 +02:00
Hassan HanyandMichael Niedermayer 2196cd43dc avcodec/x86/vorbisdsp: change cmpleps to cmpltps in inverse coupling
Changed the comparison from cmpleps to strictly less than
(cmpltps) to strictly follow the Vorbis spec

Fixes https://code.ffmpeg.org/FFmpeg/FFmpeg/issues/21501

(cherry picked from commit 9288681068)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:40:55 +02:00
Soham KuteandMichael Niedermayer 9318eb0a98 avcodec/liboapvenc: derive and validate APV profile from pixel format
(cherry picked from commit 8885116f4d)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:40:55 +02:00
Diego de SouzaandMichael Niedermayer 83853cf1e8 avcodec/nvenc: fix compatibility with Video Codec SDK 13.1
NV_ENC_CLOCK_TIMESTAMP_SET was changed in SDK 13.1: countingType was
replaced by countingTypeLSB and countingTypeMSB.

Signed-off-by: Diego de Souza <ddesouza@nvidia.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
(cherry picked from commit 0a7c5e507b)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:40:55 +02:00
Franciszek KalinowskiandMichael Niedermayer d7ceb10bfe avcodec/h264_slice: guard color_frame() against chroma-width underflow
In the >= 9 bit path, color_frame() does
`av_memcpy_backptr(dst + 2, 2, bytes - 2)`. When the effective chroma width
is 1 pixel (bytes == 1) the count becomes -1 and the underlying fill16()
loop runs roughly 2^32 times, producing a heap overflow. The original count
was also wrong in units (pixels rather than bytes); fix that at the same
time so the 2-pixel case still fills both pixels.

Confirmed via a standalone harness reproducing av_memcpy_backptr's fill16
loop with cnt = -1; reaching the call from a crafted H.264 bitstream
requires Hi10P plus a frame_num gap on a frame whose effective chroma width
is 1 pixel, which is hard to express but is reachable via mid-stream SPS
changes. Compiles cleanly; no regressions seen running existing crafted
H.264 PoCs and trivial transcodes.

Reported by Franciszek Kalinowski (isec.pl / striga.ai) and Bartosz Smigielski.

(cherry picked from commit c79dfd29e6)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:40:54 +02:00
Ori HollanderandMichael Niedermayer 9516e6900a avcodec/magicyuv: reject slice_height misaligned with chroma vshift
Fixes: poc_magicyuv.avi
Fixes: out of array access

Found-by: Ori Hollander of the JFrog Vulnerability Research team
(cherry picked from commit 374b726ffa)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:40:54 +02:00
Michael Niedermayer e302bafe79 avcodec/magicyuv: Expand the s->interlaced slice-height sanity check
Fixes: poc_magicyuv.avi
Fixes: out of array access

Found-by: Ori Hollander of the JFrog Vulnerability Research team
(cherry picked from commit 5806e8b9f3)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-14 04:40:54 +02:00
Michael Niedermayer a991b3e110 avcodec/magicyuv: Fix 1 line MEDIAN slices
No testcase

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