aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-05-29 09:58:31 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2021-09-09 13:54:52 +0200
commitc7da0dad1f17856a12c98135eae9824f771e8f3a (patch)
tree1a9b58ede7b10fcd298c84b9b386a93a69dce769
parent14e172600e65817144be48a774c9b699b9563653 (diff)
downloadffmpeg-c7da0dad1f17856a12c98135eae9824f771e8f3a.tar.gz
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> (cherry picked from commit 82ad1b76751bcfad5005440db48c46a4de5d6f02) 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 9bcc4ff16f..3dc031ae16 100644
--- a/libavfilter/vf_vmafmotion.c
+++ b/libavfilter/vf_vmafmotion.c
@@ -239,6 +239,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);