diff mbox series

[FFmpeg-devel,3/5] avfilter/vf_mestimate: Check b_count

Message ID 20210606134757.18919-3-michael@niedermayer.cc
State Accepted
Commit 06af6e101bbd04e8ecc5337bc3b6894a5e058e14
Headers show
Series [FFmpeg-devel,1/5] avfilter/vf_ciescope: Handle black as very dark neutral gray | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Michael Niedermayer June 6, 2021, 1:47 p.m. UTC
Fixes: left shift of negative value -1
Fixes: Ticket8270

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavfilter/vf_mestimate.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Michael Niedermayer July 19, 2021, 9:10 p.m. UTC | #1
On Sun, Jun 06, 2021 at 03:47:55PM +0200, Michael Niedermayer wrote:
> Fixes: left shift of negative value -1
> Fixes: Ticket8270
> 
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavfilter/vf_mestimate.c | 3 +++
>  1 file changed, 3 insertions(+)

will apply

[...]
diff mbox series

Patch

diff --git a/libavfilter/vf_mestimate.c b/libavfilter/vf_mestimate.c
index daf7fde95f..f1935244c1 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])