[vlc-devel] [PATCH] Allow the image separator to be specified on the command line

Rémi Denis-Courmont remi at remlab.net
Fri Aug 23 17:26:06 CEST 2013


Le jeudi 22 août 2013 13:02:58 David R Robison a écrit :
> -        if( !strncmp( p_sys->psz_separator, (char *)(p_sys->p_peek + i
> + 2),
> -                      strlen( p_sys->psz_separator ) ) )
> +        if( !strncmp( p_sys->psz_separator, (char *)(p_sys->p_peek + i
> + 2),
> +                      strlen( p_sys->psz_separator ) )
> +                      || (!strncmp(p_sys->psz_separator, "--", 2)
> +                      && !strncmp( p_sys->psz_separator, (char
> *)(p_sys->p_peek + i),
> +                      strlen( p_sys->psz_separator ) ) ) )

With the degenerate case of a one byte separator, the probabilty of breaking a 
valid stream reaches 50% after about 5 days at 25 f/s (and converges to 100% 
asymptotically) if I got the maths right.

I think you need to check for a minimum length here.

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




More information about the vlc-devel mailing list