summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-05-29 09:58:31 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2021-05-29 20:14:24 +0200
commit82ad1b76751bcfad5005440db48c46a4de5d6f02 (patch)
tree150c185ac1b62bfb2f83f24b3bfa958deaa972ad
parent4c1afa292520329eecd1cc7631bc59a8cca95c46 (diff)
avfilter/vf_vmafmotion: Check dimensions
Fixes: out of array access Fixes: Ticket8241 Fixes: Ticket8246 Fixes: CVE-2020-22019 Fixes: CVE-2020-22033 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavfilter/vf_vmafmotion.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavfilter/vf_vmafmotion.c b/libavfilter/vf_vmafmotion.c
index 2db4783d8d..454ebb8afa 100644
--- a/libavfilter/vf_vmafmotion.c
+++ b/libavfilter/vf_vmafmotion.c
@@ -238,6 +238,9 @@ int ff_vmafmotion_init(VMAFMotionData *s,
int i;
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(fmt);
+ if (w < 3 || h < 3)
+ return AVERROR(EINVAL);
+
s->width = w;
s->height = h;
s->stride = FFALIGN(w * sizeof(uint16_t), 32);