blob: e98ddaaede7a8cdcf4d19ec16c10be8f23917b25 [file] [log] [blame]
Patrick Williamsd767d3f2021-08-30 15:17:28 -05001From 2f3bf456fa641edf154a99c4586d7bf52c02a495 Mon Sep 17 00:00:00 2001
2From: Michael Niedermayer <michael@niedermayer.cc>
3Date: Sat, 29 May 2021 09:58:31 +0200
4Subject: [PATCH 5/5] avfilter/vf_vmafmotion: Check dimensions
5
6Fixes: out of array access
7Fixes: Ticket8241
8Fixes: Ticket8246
9Fixes: CVE-2020-22019
10Fixes: CVE-2020-22033
11
12Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
13
14CVE: CVE-2020-22033
15CVE: CVE-2020-22019
16Upstream-Status: Backport [82ad1b76751bcfad5005440db48c46a4de5d6f02]
17
18Signed-off-by: Tony Tascioglu <tony.tascioglu@windriver.com>
19---
20 libavfilter/vf_vmafmotion.c | 3 +++
21 1 file changed, 3 insertions(+)
22
23diff --git a/libavfilter/vf_vmafmotion.c b/libavfilter/vf_vmafmotion.c
24index 88d0b35095..0730147e7d 100644
25--- a/libavfilter/vf_vmafmotion.c
26+++ b/libavfilter/vf_vmafmotion.c
27@@ -238,6 +238,9 @@ int ff_vmafmotion_init(VMAFMotionData *s,
28 int i;
29 const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(fmt);
30
31+ if (w < 3 || h < 3)
32+ return AVERROR(EINVAL);
33+
34 s->width = w;
35 s->height = h;
36 s->stride = FFALIGN(w * sizeof(uint16_t), 32);
37--
382.32.0
39