ffmpeg/tests/ref
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
..
acodec fftools/ffmpeg: propagate frame durations to packets when encoding 2023-04-19 21:12:03 +02:00
fate lavfi/bwdif: fix heap-buffer-overflow with small height videos 2026-05-04 17:13:29 +02:00
lavf fftools/ffmpeg_enc: do not round frame durations prematurely 2023-10-03 16:57:02 +02:00
lavf-fate avcodec/av1dec: export pixel format even if no hardware decoder is present 2023-09-08 09:42:25 -03:00
pixfmt fate/pixfmt: test xyz12le 2021-08-29 18:44:46 +02:00
seek avformat/matroskaenc: Write default duration for audio 2023-10-02 12:22:20 +02:00
vsynth fate: add forgotten rpza reference test 2023-09-07 22:57:01 +02:00