[FFmpeg-devel] [PATCH] avfilter/vf_gblur_vulkan: Fix use of uninitialized value

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Thu Nov 18 06:30:50 EET 2021


lance.lmwang at gmail.com:
> From: Limin Wang <lance.lmwang at gmail.com>
> 
> Signed-off-by: Limin Wang <lance.lmwang at gmail.com>
> ---
>  libavfilter/vf_gblur_vulkan.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavfilter/vf_gblur_vulkan.c b/libavfilter/vf_gblur_vulkan.c
> index d4f391b..16c8bbb 100644
> --- a/libavfilter/vf_gblur_vulkan.c
> +++ b/libavfilter/vf_gblur_vulkan.c
> @@ -124,7 +124,7 @@ static av_cold void init_gaussian_params(GBlurVulkanContext *s)
>  
>  static av_cold int init_filter(AVFilterContext *ctx, AVFrame *in)
>  {
> -    int err;
> +    int err = 0;
>      char *kernel_def;
>      uint8_t *kernel_mapped;
>      FFSPIRVShader *shd;
> 

I don't see an uninitialized value at all: It is directly initialized in
some error paths and if not, it is initialized in the RET() macro. And
in any case it would be better to zero ret directly above the "fail:"
because then this function always returns zero on success even if the
last function called could return values > 0.

- Andreas


More information about the ffmpeg-devel mailing list