diff mbox series

[FFmpeg-devel,v3,3/3] avfilter/af_adelay: Check sscanf() return value

Message ID 20200329000805.22636-2-lance.lmwang@gmail.com
State Accepted
Commit f441fadbcffa32b71470220b522d4971a774e760
Headers show
Series [FFmpeg-devel,v3,1/3] avfilter/af_acrossover: Check sscanf() return value
Related show

Commit Message

Limin Wang March 29, 2020, 12:08 a.m. UTC
From: Limin Wang <lance.lmwang@gmail.com>

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
---
 libavfilter/af_adelay.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavfilter/af_adelay.c b/libavfilter/af_adelay.c
index c964777..6ac81c2 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;
         }