[FFmpeg-devel] [PATCH 02/60] fftools/opt_common: fix variable shadowing

Anton Khirnov anton at khirnov.net
Mon Sep 9 13:10:35 EEST 2024


Quoting Marvin Scholz (2024-09-08 19:43:27)
> ---
>  fftools/opt_common.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/fftools/opt_common.c b/fftools/opt_common.c
> index 9d2d5184a0..059f7a53d2 100644
> --- a/fftools/opt_common.c
> +++ b/fftools/opt_common.c
> @@ -553,15 +553,15 @@ static void show_help_filter(const char *name)
>  }
>  #endif
>  
> -static void show_help_bsf(const char *name)
> +static void show_help_bsf(const char *bsf_name)
>  {
> -    const AVBitStreamFilter *bsf = av_bsf_get_by_name(name);
> +    const AVBitStreamFilter *bsf = av_bsf_get_by_name(bsf_name);
>  
> -    if (!name) {
> +    if (!bsf_name) {
>          av_log(NULL, AV_LOG_ERROR, "No bitstream filter name specified.\n");
>          return;
>      } else if (!bsf) {
> -        av_log(NULL, AV_LOG_ERROR, "Unknown bit stream filter '%s'.\n", name);
> +        av_log(NULL, AV_LOG_ERROR, "Unknown bit stream filter '%s'.\n", bsf_name);

What does this fix? I don't see any other instance of 'name' in this
function.

>          return;
>      }
>  
> @@ -1205,10 +1205,10 @@ int init_report(const char *env, FILE **file)
>  
>      report_file = fopen(filename.str, "w");
>      if (!report_file) {
> -        int ret = AVERROR(errno);
> +        int err = AVERROR(errno);
>          av_log(NULL, AV_LOG_ERROR, "Failed to open report \"%s\": %s\n",
>                 filename.str, strerror(errno));
> -        return ret;
> +        return err;

Might as well use the outer ret.

-- 
Anton Khirnov


More information about the ffmpeg-devel mailing list