[vlc-devel] [PATCH] nvdec: avoid crash when nvdec context fails to initialize

Steve Lhomme robux4 at ycbcr.xyz
Fri Oct 4 15:04:07 CEST 2019


Good catch. Will merge. Thanks !

On 2019-10-04 11:09, Pierre Lamot wrote:
>    GetNVDECOpaqueDevice used in DecoderContextClose expects the
>    device type to be set to VLC_DECODER_DEVICE_NVDEC
> ---
>   modules/hw/nvdec/nvdec.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/modules/hw/nvdec/nvdec.c b/modules/hw/nvdec/nvdec.c
> index 4040c08ae8..b13152456d 100644
> --- a/modules/hw/nvdec/nvdec.c
> +++ b/modules/hw/nvdec/nvdec.c
> @@ -952,6 +952,8 @@ DecoderContextOpen(vlc_decoder_device *device, vout_window_t *window)
>       if (unlikely(p_sys == NULL))
>           return VLC_ENOMEM;
>       device->opaque = p_sys;
> +    device->ops = &dev_ops;
> +    device->type = VLC_DECODER_DEVICE_NVDEC;
>       p_sys->cudaFunctions = NULL;
>   
>       int result = cuda_load_functions(&p_sys->cudaFunctions, device);
> @@ -973,8 +975,6 @@ DecoderContextOpen(vlc_decoder_device *device, vout_window_t *window)
>           return result;
>       }
>   
> -    device->ops = &dev_ops;
> -    device->type = VLC_DECODER_DEVICE_NVDEC;
>       return VLC_SUCCESS;
>   }
>   
> -- 
> 2.20.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