blob: 5d979ca3f203cad730c3fb8c8023a7ae463e9f4f [file] [log] [blame]
Patrick Williams213cb262021-08-07 19:21:33 -05001From 82ad1b76751bcfad5005440db48c46a4de5d6f02 Mon Sep 17 00:00:00 2001
2From: Michael Niedermayer <michael@niedermayer.cc>
3Date: Sat, 29 May 2021 09:58:31 +0200
4Subject: [PATCH] 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
14
15CVE: CVE-2020-22033
16CVE: CVE-2020-22019
17Upstream-Status: Backport [82ad1b76751bcfad5005440db48c46a4de5d6f02]
18
19Signed-off-by: Tony Tascioglu <tony.tascioglu@windriver.com>
20---
21 libavfilter/vf_vmafmotion.c | 3 +++
22 1 file changed, 3 insertions(+)
23
24diff --git a/libavfilter/vf_vmafmotion.c b/libavfilter/vf_vmafmotion.c
25index 2db4783d8d..454ebb8afa 100644
26--- a/libavfilter/vf_vmafmotion.c
27+++ b/libavfilter/vf_vmafmotion.c
28@@ -238,6 +238,9 @@ int ff_vmafmotion_init(VMAFMotionData *s,
29 int i;
30 const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(fmt);
31
32+ if (w < 3 || h < 3)
33+ return AVERROR(EINVAL);
34+
35 s->width = w;
36 s->height = h;
37 s->stride = FFALIGN(w * sizeof(uint16_t), 32);
38--
392.32.0
40