[vlc-devel] [PATCH] nvdec: fix segfault in nvdec_gl

Steve Lhomme robux4 at ycbcr.xyz
Mon Apr 6 08:55:56 CEST 2020


On 2020-04-03 17:44, quentin.chateau at deepskycorp.com wrote:
> From: Quentin Chateau <quentin.chateau at deepskycorp.com>
> 
> ---
>   modules/hw/nvdec/nvdec_gl.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/modules/hw/nvdec/nvdec_gl.c b/modules/hw/nvdec/nvdec_gl.c
> index 137e730028..18a34d061c 100644
> --- a/modules/hw/nvdec/nvdec_gl.c
> +++ b/modules/hw/nvdec/nvdec_gl.c
> @@ -150,7 +150,8 @@ static void Close(vlc_object_t *obj)
>   {
>       struct vlc_gl_interop *interop = (void *)obj;
>       converter_sys_t *p_sys = interop->priv;
> -    vlc_decoder_device_Release(p_sys->device);
> +    if (p_sys)
> +        vlc_decoder_device_Release(p_sys->device);

This is very suspicious. p_sys is owned by this object and not used by 
anyone else. It's allocated with vlc_obj_malloc() so doesn't need to be 
freed manually and is valid as long the object is valid.

If the pointer is wonrg it's a sign something is not working right 
elsewhere.

>   }
>   
>   static int Open(vlc_object_t *obj)
> -- 
> 2.17.1
> 
> _______________________________________________
> 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