diff mbox series

[FFmpeg-devel,v1,2/3] avfilter/vf_mix: Check sscanf() return value

Message ID 20200325230424.2787-2-lance.lmwang@gmail.com
State New
Headers show
Series [FFmpeg-devel,v1,1/3] avfilter/af_acrossover: Check sscanf() return value
Related show

Checks

Context Check Description
andriy/ffmpeg-patchwork pending
andriy/ffmpeg-patchwork success Applied patch
andriy/ffmpeg-patchwork success Configure finished
andriy/ffmpeg-patchwork success Make finished
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Limin Wang March 25, 2020, 11:04 p.m. UTC
From: Limin Wang <lance.lmwang@gmail.com>

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
---
 libavfilter/vf_mix.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavfilter/vf_mix.c b/libavfilter/vf_mix.c
index 9e1ae79e00..e47f7e2301 100644
--- a/libavfilter/vf_mix.c
+++ b/libavfilter/vf_mix.c
@@ -108,7 +108,8 @@  static av_cold int init(AVFilterContext *ctx)
             break;
 
         p = NULL;
-        av_sscanf(arg, "%f", &s->weights[i]);
+        if (av_sscanf(arg, "%f", &s->weights[i]) != 1)
+            continue;
         s->wfactor += s->weights[i];
         last = i;
     }