diff options
author | Limin Wang <lance.lmwang@gmail.com> | 2020-03-29 08:08:05 +0800 |
---|---|---|
committer | Limin Wang <lance.lmwang@gmail.com> | 2020-05-01 06:36:36 +0800 |
commit | f441fadbcffa32b71470220b522d4971a774e760 (patch) | |
tree | 6d65476ee1f97ba49ea76243ed017da99505d02d /libavfilter | |
parent | ee5d6d2ef88a3a7fd480435cf931dd6165bbb688 (diff) | |
download | ffmpeg-f441fadbcffa32b71470220b522d4971a774e760.tar.gz |
avfilter/af_adelay: Check sscanf() return value
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/af_adelay.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavfilter/af_adelay.c b/libavfilter/af_adelay.c index c9647771f2..6ac81c2a3e 100644 --- a/libavfilter/af_adelay.c +++ b/libavfilter/af_adelay.c @@ -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; } |