[vlc-devel] [PATCH] filter_chain: check filter_owner callbacks

Steve Lhomme robux4 at ycbcr.xyz
Tue Jul 28 12:13:52 CEST 2020


LGTM

On 2020-07-28 12:07, Alexandre Janniaux wrote:
> sys = chain is guaranteed to be non-null since it's a callback from a
> filter_chain_t but the underlying owner can be left zero-initialized in
> case there is no decoder device, or dec-dev=none is set so it cannot be
> deferenced without checking it first.
> ---
>   src/misc/filter_chain.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/src/misc/filter_chain.c b/src/misc/filter_chain.c
> index 4c2a3c58f9..8221278211 100644
> --- a/src/misc/filter_chain.c
> +++ b/src/misc/filter_chain.c
> @@ -107,7 +107,9 @@ static picture_t *filter_chain_VideoBufferNew( filter_t *filter )
>   static vlc_decoder_device * filter_chain_HoldDecoderDevice(vlc_object_t *o, void *sys)
>   {
>       filter_chain_t *chain = sys;
> -    if (!chain->parent_video_owner.video->hold_device)
> +
> +    if (chain->parent_video_owner.video == NULL ||
> +        chain->parent_video_owner.video->hold_device == NULL)
>           return NULL;
>   
>       return chain->parent_video_owner.video->hold_device(o, chain->parent_video_owner.sys);
> -- 
> 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