diff mbox series

[FFmpeg-devel,v1,1/3] avfilter/af_acrossover: Check sscanf() return value

Message ID 20200325230424.2787-1-lance.lmwang@gmail.com
State Superseded
Headers show
Series [FFmpeg-devel,v1,1/3] avfilter/af_acrossover: Check sscanf() return value
Related show

Checks

Context Check Description
andriy/ffmpeg-patchwork pending
andriy/ffmpeg-patchwork success Applied patch
andriy/ffmpeg-patchwork success Configure finished
andriy/ffmpeg-patchwork success Make finished
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Limin Wang March 25, 2020, 11:04 p.m. UTC
From: Limin Wang <lance.lmwang@gmail.com>

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

Patch

diff --git a/libavfilter/af_acrossover.c b/libavfilter/af_acrossover.c
index 20d1d2bda9..c9404b95cd 100644
--- a/libavfilter/af_acrossover.c
+++ b/libavfilter/af_acrossover.c
@@ -98,7 +98,8 @@  static av_cold int init(AVFilterContext *ctx)
 
         p = NULL;
 
-        av_sscanf(arg, "%f", &freq);
+        if (av_sscanf(arg, "%f", &freq) != 1)
+            return AVERROR(EINVAL);
         if (freq <= 0) {
             av_log(ctx, AV_LOG_ERROR, "Frequency %f must be positive number.\n", freq);
             return AVERROR(EINVAL);