Browse Source

avfilter/vf_mix: Check sscanf() return value

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
tags/n4.3
Limin Wang 6 years ago
parent
commit
ee5d6d2ef8
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      libavfilter/vf_mix.c

+ 4
- 1
libavfilter/vf_mix.c View File

@@ -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;
}


Loading…
Cancel
Save