[vlc-devel] [PATCH] display: release the video context if creating the converters failed

Thomas Guillem thomas at gllm.fr
Tue Jan 19 12:43:29 UTC 2021


LGTM

On Tue, Jan 19, 2021, at 13:31, Steve Lhomme wrote:
> The video context is held a few lines before. But we're not going to use it
> anymore after this failure. No need to keep it any longer and
> vout_display_Delete() is never going to be called since vout_display_New()
> never returned a vout_display_t*.
> ---
>  src/video_output/display.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/src/video_output/display.c b/src/video_output/display.c
> index 9ada4bedd44..cc257708e30 100644
> --- a/src/video_output/display.c
> +++ b/src/video_output/display.c
> @@ -738,6 +738,11 @@ vout_display_t *vout_display_New(vlc_object_t *parent,
>              vd->ops->close(vd);
>          vlc_objres_clear(VLC_OBJECT(vd));
>          video_format_Clean(&osys->display_fmt);
> +        if (osys->src_vctx)
> +        {
> +            vlc_video_context_Release(osys->src_vctx);
> +            osys->src_vctx = NULL;
> +        }
>          goto error;
>      }
>      return vd;
> -- 
> 2.29.2
> 
> _______________________________________________
> 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