ffmpeg/tests
Jun Zhao fdfe4d2cfb
lavfi/bwdif: fix heap-buffer-overflow with small height videos
Reproduce:
  ffmpeg -i /tmp/bwdif_test_input_160x4_gray16.jpg -vf "bwdif" -f null -

filter_intra accesses rows 3 lines away via cur[mrefs3] and cur[prefs3].
For small height videos (h <= 4), this causes heap-buffer-overflow.

Add boundary check for filter_intra when YADIF_FIELD_END is set.
The boundary condition (y < 3) or (y + 3 >= td->h) precisely matches
filter_intra's 3-line context requirement.

Test file: 160x4 gray16 JPEG
https://code.ffmpeg.org/attachments/db2ace24-bc00-4af6-a53a-5df6b0d51b15

fix #21570

Reviewed-by: Thomas Mundt <tmundt75@gmail.com>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
(cherry picked from commit 795bccdaf5)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-05-04 17:13:29 +02:00
..
api tests/api: use AVFrame.duration instead of AVFrame.pkt_duration 2022-07-19 12:27:18 +02:00
checkasm riscv: test for assembler support 2024-12-07 02:37:17 -05:00
fate all: apply linter fixes 2025-12-03 20:27:24 +01:00
filtergraphs tests/fate: Add test for overlay filter using yuv444p10 output format 2023-07-20 16:49:20 +02:00
ref lavfi/bwdif: fix heap-buffer-overflow with small height videos 2026-05-04 17:13:29 +02:00
.gitignore
audiogen.c tests/audiogen: raise channel count limit to 12 2018-07-30 10:46:10 +02:00
audiomatch.c tests/audiomatch: add free to make static analysis tools happy 2020-12-10 19:38:32 +08:00
base64.c
copycooker.sh
extended.ffconcat all: apply linter fixes 2025-12-03 20:27:24 +01:00
fate-run.sh tests/fate-run: Ensure that THREADS=random is actually random 2023-09-25 22:02:24 +02:00
fate-valgrind.supp
fate.sh libavresample: Remove deprecated library 2021-04-27 10:43:13 -03:00
Makefile avcodec: Remove DCT, FFT, MDCT and RDFT 2023-10-01 02:25:09 +02:00
md5.sh
refcmp-metadata.awk fate/filter-refcmp-*: make refcmp_metadata fail on empty or truncated input 2022-04-10 20:12:23 +02:00
reference.pnm
rotozoom.c
simple1.ffconcat all: apply linter fixes 2025-12-03 20:27:24 +01:00
simple2.ffconcat all: apply linter fixes 2025-12-03 20:27:24 +01:00
test.ffmeta
tiny_psnr.c
tiny_ssim.c test: tiny_ssim: Don't include config.h 2022-03-30 14:56:07 +03:00
utils.c
videogen.c