Patrick Williams | d767d3f | 2021-08-30 15:17:28 -0500 | [diff] [blame] | 1 | From 2f3bf456fa641edf154a99c4586d7bf52c02a495 Mon Sep 17 00:00:00 2001 |
| 2 | From: Michael Niedermayer <michael@niedermayer.cc> |
| 3 | Date: Sat, 29 May 2021 09:58:31 +0200 |
| 4 | Subject: [PATCH 5/5] avfilter/vf_vmafmotion: Check dimensions |
| 5 | |
| 6 | Fixes: out of array access |
| 7 | Fixes: Ticket8241 |
| 8 | Fixes: Ticket8246 |
| 9 | Fixes: CVE-2020-22019 |
| 10 | Fixes: CVE-2020-22033 |
| 11 | |
| 12 | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> |
| 13 | |
| 14 | CVE: CVE-2020-22033 |
| 15 | CVE: CVE-2020-22019 |
| 16 | Upstream-Status: Backport [82ad1b76751bcfad5005440db48c46a4de5d6f02] |
| 17 | |
| 18 | Signed-off-by: Tony Tascioglu <tony.tascioglu@windriver.com> |
| 19 | --- |
| 20 | libavfilter/vf_vmafmotion.c | 3 +++ |
| 21 | 1 file changed, 3 insertions(+) |
| 22 | |
| 23 | diff --git a/libavfilter/vf_vmafmotion.c b/libavfilter/vf_vmafmotion.c |
| 24 | index 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 | -- |
| 38 | 2.32.0 |
| 39 | |