[FFmpeg-cvslog] avfilter/af_acrossover: Check sscanf() return value

Limin Wang git at videolan.org
Fri Apr 17 17:57:25 EEST 2020


ffmpeg | branch: master | Limin Wang <lance.lmwang at gmail.com> | Sun Mar 29 08:08:04 2020 +0800| [403bee30a57bfa77efebddcebc546df9d3876db2] | committer: Paul B Mahol

avfilter/af_acrossover: Check sscanf() return value

Signed-off-by: Limin Wang <lance.lmwang at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=403bee30a57bfa77efebddcebc546df9d3876db2
---

 libavfilter/af_acrossover.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavfilter/af_acrossover.c b/libavfilter/af_acrossover.c
index f70c50b3ed..002f378c3d 100644
--- a/libavfilter/af_acrossover.c
+++ b/libavfilter/af_acrossover.c
@@ -99,7 +99,10 @@ static av_cold int init(AVFilterContext *ctx)
 
         p = NULL;
 
-        av_sscanf(arg, "%f", &freq);
+        if (av_sscanf(arg, "%f", &freq) != 1) {
+            av_log(ctx, AV_LOG_ERROR, "Invalid syntax for frequency[%d].\n", i);
+            return AVERROR(EINVAL);
+        }
         if (freq <= 0) {
             av_log(ctx, AV_LOG_ERROR, "Frequency %f must be positive number.\n", freq);
             return AVERROR(EINVAL);



More information about the ffmpeg-cvslog mailing list