]> git.sesse.net Git - vlc/commitdiff
mjpeg: work around broken MIME separators in crappy firmwares
authorDavid R Robison <drrobison@openroadsconsulting.com>
Mon, 2 Sep 2013 15:40:05 +0000 (18:40 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Mon, 2 Sep 2013 15:40:05 +0000 (18:40 +0300)
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
modules/demux/mjpeg.c

index 8def7f809a298bb877d0b590d380d11b05cc79e4..2c076adeea5bb03a690f17d56be7c9cee67275ba 100644 (file)
@@ -508,8 +508,13 @@ 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 ) ) )
+        /* Handle old and new style of separators */
+        if (!strncmp(p_sys->psz_separator, (char *)(p_sys->p_peek + i + 2),
+                     strlen( p_sys->psz_separator ))
+         || ((strlen(p_sys->psz_separator) > 4)
+          && !strncmp(p_sys->psz_separator, "--", 2)
+          && !strncmp(p_sys->psz_separator, (char *)(p_sys->p_peek + i),
+                      strlen( p_sys->psz_separator))))
         {
             break;
         }