diff options
author | Limin Wang <lance.lmwang@gmail.com> | 2020-03-29 09:08:13 +0800 |
---|---|---|
committer | Limin Wang <lance.lmwang@gmail.com> | 2020-05-01 06:36:36 +0800 |
commit | ee5d6d2ef88a3a7fd480435cf931dd6165bbb688 (patch) | |
tree | c9521afbaf149ab33c62e1ea39ceeff956ae7bda /libavfilter | |
parent | 8296443a70f052a6f5c9a867d28b83a5eb7d304d (diff) | |
download | ffmpeg-ee5d6d2ef88a3a7fd480435cf931dd6165bbb688.tar.gz |
avfilter/vf_mix: Check sscanf() return value
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/vf_mix.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavfilter/vf_mix.c b/libavfilter/vf_mix.c index f418c6fba8..bdb67d8e5a 100644 --- a/libavfilter/vf_mix.c +++ b/libavfilter/vf_mix.c @@ -108,7 +108,10 @@ 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) { + av_log(ctx, AV_LOG_ERROR, "Invalid syntax for weights[%d].\n", i); + return AVERROR(EINVAL); + } s->wfactor += s->weights[i]; last = i; } |