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

David R Robison drrobison at openroadsconsulting.com
Fri Aug 23 20:29:11 CEST 2013


I'm sorry but I am completely unfamiliar with GIT. I do not know now to 
diff my changed file with what is currently on the master repository. 
Anyway, here is a patch to my patch. Does this look better? David

diff --git a/modules/demux/mjpeg.c b/modules/demux/mjpeg.c
index 3a73252..b673e6f 100644
--- a/modules/demux/mjpeg.c
+++ b/modules/demux/mjpeg.c
@@ -510,8 +510,9 @@ static int MimeDemux( demux_t *p_demux )

          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),
+                      || (!strncmp(p_sys->psz_separator, "--", 2)
+                      && (strlen( p_sys->psz_separator ) > 4)
+                      && !strncmp( p_sys->psz_separator, (char 
*)(p_sys->p_peek + i),
                        strlen( p_sys->psz_separator ) ) ) )
          {
              break;
-- 

David R Robison
Open Roads Consulting, Inc.
103 Watson Road, Chesapeake, VA 23320
phone: (757) 546-3401
e-mail: drrobison at openroadsconsulting.com
web: http://openroadsconsulting.com
blog: http://therobe.blogspot.com
book: http://www.xulonpress.com/bookstore/bookdetail.php?PB_ISBN=9781597816526

On 8/23/2013 11:26 AM, Rémi Denis-Courmont wrote:
> 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.
>



This email communication (including any attachments) may contain confidential and/or privileged material intended solely for the individual or entity to which it is addressed.
If you are not the intended recipient, please delete this email immediately.




More information about the vlc-devel mailing list