Commit ee5d6d2e authored by Limin Wang's avatar Limin Wang

avfilter/vf_mix: Check sscanf() return value

Reviewed-by: 's avatarNicolas George <george@nsup.org>
Signed-off-by: 's avatarLimin Wang <lance.lmwang@gmail.com>
parent 8296443a
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment