[vlc-devel] [PATCH] video context: don't create video contexts with no type

Thomas Guillem thomas at gllm.fr
Tue Nov 5 14:58:47 CET 2019


OK

On Mon, Nov 4, 2019, at 13:20, Steve Lhomme wrote:
> We keep VLC_VIDEO_CONTEXT_NONE to 0 to make sure some context are not created
> accidentally with a type value of 0.
> ---
>  src/input/decoder_helpers.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/input/decoder_helpers.c b/src/input/decoder_helpers.c
> index 3d8a06985db..3f1eb9ff1d6 100644
> --- a/src/input/decoder_helpers.c
> +++ b/src/input/decoder_helpers.c
> @@ -243,6 +243,7 @@ vlc_video_context * 
> vlc_video_context_Create(vlc_decoder_device *device,
>                                            size_t private_size,
>                                            const struct 
> vlc_video_context_operations *ops)
>  {
> +    assert(private_type != VLC_VIDEO_CONTEXT_NONE); // use a NULL 
> video context for that
>      vlc_video_context *vctx = malloc(sizeof(*vctx) + private_size);
>      if (unlikely(vctx == NULL))
>          return NULL;
> -- 
> 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