Commit f441fadb authored by Limin Wang's avatar Limin Wang

avfilter/af_adelay: Check sscanf() return value

Reviewed-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
Signed-off-by: 's avatarLimin Wang <lance.lmwang@gmail.com>
parent ee5d6d2e
...@@ -155,7 +155,10 @@ static int config_input(AVFilterLink *inlink) ...@@ -155,7 +155,10 @@ static int config_input(AVFilterLink *inlink)
ret = av_sscanf(arg, "%d%c", &d->delay, &type); ret = av_sscanf(arg, "%d%c", &d->delay, &type);
if (ret != 2 || type != 'S') { if (ret != 2 || type != 'S') {
div = type == 's' ? 1.0 : 1000.0; div = type == 's' ? 1.0 : 1000.0;
av_sscanf(arg, "%f", &delay); if (av_sscanf(arg, "%f", &delay) != 1) {
av_log(ctx, AV_LOG_ERROR, "Invalid syntax for delay.\n");
return AVERROR(EINVAL);
}
d->delay = delay * inlink->sample_rate / div; d->delay = delay * inlink->sample_rate / div;
} }
......
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