diff mbox series

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

Message ID 20200329000805.22636-1-lance.lmwang@gmail.com
State Accepted
Commit 403bee30a57bfa77efebddcebc546df9d3876db2
Headers show
Series [FFmpeg-devel,v3,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 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_acrossover.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Limin Wang April 17, 2020, 2:18 p.m. UTC | #1
ping for merge please.

On Sun, Mar 29, 2020 at 08:08:04AM +0800, lance.lmwang@gmail.com wrote:
> From: Limin Wang <lance.lmwang@gmail.com>
> 
> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
> ---
>  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 f70c50b..002f378 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);
> -- 
> 2.9.5
>
Paul B Mahol April 17, 2020, 2:34 p.m. UTC | #2
On 4/17/20, Limin Wang <lance.lmwang@gmail.com> wrote:
>
> ping for merge please.

trival patch, apply at will.

>
> On Sun, Mar 29, 2020 at 08:08:04AM +0800, lance.lmwang@gmail.com wrote:
>> From: Limin Wang <lance.lmwang@gmail.com>
>>
>> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
>> ---
>>  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 f70c50b..002f378 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);
>> --
>> 2.9.5
>>
>
> --
> Thanks,
> Limin Wang
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
Nicolas George April 17, 2020, 2:37 p.m. UTC | #3
Paul B Mahol (12020-04-17):
> trival patch, apply at will.

It is not a trivial patch when it has required a v3.

Let's stop applying at will.
Limin Wang April 17, 2020, 2:40 p.m. UTC | #4
On Fri, Apr 17, 2020 at 04:34:28PM +0200, Paul B Mahol wrote:
> On 4/17/20, Limin Wang <lance.lmwang@gmail.com> wrote:
> >
> > ping for merge please.
> 
> trival patch, apply at will.

I can't push it directly, so ping it for developer/maintainer help to apply it.

> 
> >
> > On Sun, Mar 29, 2020 at 08:08:04AM +0800, lance.lmwang@gmail.com wrote:
> >> From: Limin Wang <lance.lmwang@gmail.com>
> >>
> >> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
> >> ---
> >>  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 f70c50b..002f378 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);
> >> --
> >> 2.9.5
> >>
> >
> > --
> > Thanks,
> > Limin Wang
> > _______________________________________________
> > ffmpeg-devel mailing list
> > ffmpeg-devel@ffmpeg.org
> > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >
> > To unsubscribe, visit link above, or email
> > ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
diff mbox series

Patch

diff --git a/libavfilter/af_acrossover.c b/libavfilter/af_acrossover.c
index f70c50b..002f378 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);