[vlc-devel] [PATCH 01/14] videotoolbox: fix leak in ExtradataInfoCreate

Thomas Guillem thomas at gllm.fr
Fri Jul 3 09:29:34 CEST 2020


Hello,

Set LGTM, thanks for this cleanup !

On Fri, Jul 3, 2020, at 04:27, Marvin Scholz wrote:
> If p_data is null, the already created extradataInfo was leaked.
> Check p_data first and error out early to prevent even creating
> the extradataInfo if its never used.
> ---
>  modules/codec/videotoolbox.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/modules/codec/videotoolbox.c b/modules/codec/videotoolbox.c
> index 4a0912cb08..30d3d330ac 100644
> --- a/modules/codec/videotoolbox.c
> +++ b/modules/codec/videotoolbox.c
> @@ -1627,11 +1627,11 @@ static int ConfigureVout(decoder_t *p_dec)
>  static CFMutableDictionaryRef ExtradataInfoCreate(CFStringRef name,
>                                                    void *p_data, size_t i_data)
>  {
> -    CFMutableDictionaryRef extradataInfo = cfdict_create(1);
> -    if (extradataInfo == NULL)
> +    if (p_data == NULL)
>          return NULL;
>  
> -    if (p_data == NULL)
> +    CFMutableDictionaryRef extradataInfo = cfdict_create(1);
> +    if (extradataInfo == NULL)
>          return NULL;
>  
>      CFDataRef extradata = CFDataCreate(kCFAllocatorDefault, p_data, i_data);
> -- 
> 2.24.3 (Apple Git-128)
> 
> _______________________________________________
> 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