mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
avfilter/af_adelay: Check sscanf() return value
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
This commit is contained in:
parent
ee5d6d2ef8
commit
f441fadbcf
@ -155,7 +155,10 @@ static int config_input(AVFilterLink *inlink)
|
||||
ret = av_sscanf(arg, "%d%c", &d->delay, &type);
|
||||
if (ret != 2 || type != 'S') {
|
||||
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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user