[vlc-devel] [PATCH] scale: remove dead code

Filip Roséen filip at atch.se
Thu Sep 1 14:01:02 CEST 2016



On 16/08/31 22:33, Rémi Denis-Courmont wrote:

> Picture dimensions should never be zero, since most filters and outputs
> will not deal with it.

 - Do we have a relevant `assert` somewhere that is triggered when the
   dimensions are zero?

I think that would be a viable addition to the patch, or perhaps state
somewhere in the documentation that dimensions that includes such
value results in *undefined-behavior* (together with an `assert`).

> 
> If they were, this code would leak the picture pool in under a second
> anyway.
> 
> This reverts commit e62911abc7df0de022a467f3e5b373f324cc4078.
> ---
>  modules/video_filter/scale.c | 8 --------
>  1 file changed, 8 deletions(-)
> 
> diff --git a/modules/video_filter/scale.c b/modules/video_filter/scale.c
> index b06b4f0..818aa28 100644
> --- a/modules/video_filter/scale.c
> +++ b/modules/video_filter/scale.c
> @@ -90,14 +90,6 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
>  
>      if( !p_pic ) return NULL;
>  
> -    if( (p_filter->fmt_in.video.i_height == 0) ||
> -        (p_filter->fmt_in.video.i_width == 0) )
> -        return NULL;
> -
> -    if( (p_filter->fmt_out.video.i_height == 0) ||
> -        (p_filter->fmt_out.video.i_width == 0) )
> -        return NULL;
> -
>      video_format_ScaleCropAr( &p_filter->fmt_out.video, &p_filter->fmt_in.video );
>  
>      /* Request output picture */
> -- 
> 2.9.3
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20160901/d53debbb/attachment.html>


More information about the vlc-devel mailing list