[vlc-devel] [PATCH 1/2] cvpx: fix error case in Open

Thomas Guillem thomas at gllm.fr
Wed Aug 12 10:34:56 CEST 2020


Hello,

On Tue, Jul 28, 2020, at 13:54, Alexandre Janniaux wrote:
> As the code was returning `ret` but didn't set it before jumping to the
> error: label. In case of error, p_sys wasn't NULL too, which could lead
> to failure in other filters.
> ---
>  modules/video_chroma/cvpx.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/modules/video_chroma/cvpx.c b/modules/video_chroma/cvpx.c
> index 00736d8ea0..147d064ff7 100644
> --- a/modules/video_chroma/cvpx.c
> +++ b/modules/video_chroma/cvpx.c
> @@ -361,7 +361,8 @@ static int Open(vlc_object_t *obj)
>      return VLC_SUCCESS;
>  error:
>      Close(obj);
> -    return ret;
> +    p_filter->p_sys = NULL;

Not needed if patch 2/2 is applied, right?


> +    return ret == VLC_SUCCESS ? VLC_EGENERIC : ret;

This seems counterintuitive.

Either, always return VLC_EGENERIC or set ret before all goto errors;

>  #undef CASE_CVPX_INPUT
>  #undef CASE_CVPX_OUTPUT
>  }
> -- 
> 2.27.0
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list