aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-06-05 20:04:45 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2021-09-09 13:54:52 +0200
commit6ce4989432d6ac71ad05c5e82f551545258c0b3e (patch)
tree3ba252cb2d37322a0946e854d0d6ff18c50c6fc1 /libavfilter
parentfb7379f7ef2bf3df27c8e889573b6b0b08da848b (diff)
downloadffmpeg-6ce4989432d6ac71ad05c5e82f551545258c0b3e.tar.gz
avfilter/vf_mestimate: Check b_count
Fixes: left shift of negative value -1 Fixes: Ticket8270 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 06af6e101bbd04e8ecc5337bc3b6894a5e058e14) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/vf_mestimate.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavfilter/vf_mestimate.c b/libavfilter/vf_mestimate.c
index 7ecfe7da60..9a2865a0cb 100644
--- a/libavfilter/vf_mestimate.c
+++ b/libavfilter/vf_mestimate.c
@@ -100,6 +100,9 @@ static int config_input(AVFilterLink *inlink)
s->b_height = inlink->h >> s->log2_mb_size;
s->b_count = s->b_width * s->b_height;
+ if (s->b_count == 0)
+ return AVERROR(EINVAL);
+
for (i = 0; i < 3; i++) {
s->mv_table[i] = av_mallocz_array(s->b_count, sizeof(*s->mv_table[0]));
if (!s->mv_table[i])