[vlc-devel] [PATCH 2/4] subpicture private data condition

Rémi Denis-Courmont remi at remlab.net
Fri Mar 25 14:28:18 CET 2011


On Fri, 25 Mar 2011 00:22:50 +0200, Yuval Tze <yuvaltze at gmail.com> wrote:
> check that the private data is not null before accessing it.

Is it because private is NULL for sub, and non-NULL for sub2? It would be
nice to include an explanatory comment in the patch for future generations
of VLC developers ;-)

> ---
>  src/misc/subpicture.c |   10 +++++-----
>  1 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/src/misc/subpicture.c b/src/misc/subpicture.c
> index 3e84a27..a1ee386 100644
> --- a/src/misc/subpicture.c
> +++ b/src/misc/subpicture.c
> @@ -152,11 +152,11 @@ void subpicture_Update( subpicture_t
*p_subpicture,
>      if( !p_upd->pf_validate )
>          return;
>      if( !p_upd->pf_validate( p_subpicture,
> -                          !video_format_IsSimilar( p_fmt_src,
> -                                                   &p_private->src ),
> p_fmt_src,
> -                          !video_format_IsSimilar( p_fmt_dst,
> -                                                   &p_private->dst ),
> p_fmt_dst,
> -                          i_ts ) )
> +                             p_private ? !video_format_IsSimilar(
> p_fmt_src, &p_private->src ) : false,
> +                             p_fmt_src,
> +                             p_private ? !video_format_IsSimilar(
> p_fmt_dst, &p_private->dst ) : false,
> +                             p_fmt_dst,
> +                             i_ts ) )
>          return;
>  
>      subpicture_region_ChainDelete( p_subpicture->p_region );

-- 
Rémi Denis-Courmont
http://www.remlab.net/



More information about the vlc-devel mailing list