1
0
mirror of https://git.ffmpeg.org/ffmpeg.git synced 2026-10-28 15:19:38 +03:00
Files
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
..
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2023-06-30 08:26:38 -03:00
2023-06-30 08:26:38 -03:00
2023-06-30 08:26:38 -03:00
2023-06-30 08:26:38 -03:00
2023-07-07 11:56:37 -03:00
2023-06-30 08:26:38 -03:00
2023-07-07 11:56:37 -03:00
2023-06-30 08:26:38 -03:00
2023-06-30 08:26:38 -03:00
2023-06-30 08:26:38 -03:00
2023-06-30 08:26:38 -03:00
2023-06-30 08:26:38 -03:00
2023-06-30 08:26:38 -03:00
2023-06-30 08:26:38 -03:00
2023-06-30 08:26:38 -03:00
2023-06-30 08:26:38 -03:00
2023-06-30 08:26:38 -03:00
2023-06-30 08:26:38 -03:00
2023-06-30 08:26:38 -03:00
2023-06-30 08:26:38 -03:00
2023-06-30 08:26:38 -03:00
2023-06-30 08:26:38 -03:00
…
…
…
…
…
…
…
…
…
2022-11-06 14:39:27 +01:00
2022-11-06 14:39:27 +01:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2023-04-22 11:20:58 -03:00
…
…
…
…
…
…
…
…
…
…
2023-02-18 14:41:20 -08:00
…
…
…
…
…
…
…
…
…
2023-05-17 12:37:42 +02:00
2023-05-17 12:37:42 +02:00
2023-05-17 12:37:42 +02:00
2023-05-17 12:37:42 +02:00
2023-05-17 12:37:42 +02:00
2023-04-21 09:55:12 -04:00
2023-04-21 09:55:12 -04:00
…
…
…
…
…
…
…
2023-09-06 11:59:20 +02:00
2023-09-04 19:29:21 +02:00
…
…
…
…
…
…
…
…
…
2023-03-15 00:12:59 +08:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2022-10-02 20:27:36 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2022-09-13 14:50:01 +02:00
2022-09-13 14:50:01 +02:00
2022-09-13 14:50:01 +02:00
2022-09-13 14:50:01 +02:00
2023-01-13 11:22:59 -06:00
2022-09-13 14:50:01 +02:00
2022-09-13 14:50:01 +02:00
2022-09-13 14:50:01 +02:00
2022-09-13 14:50:01 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2022-11-06 14:39:27 +01:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2022-11-07 16:08:35 +11:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…