1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00

avfilter/vf_mix: Check sscanf() return value

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
This commit is contained in:
Limin Wang 2020-03-29 09:08:13 +08:00
parent 8296443a70
commit ee5d6d2ef8

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