[vlc-commits] mjpeg: work around broken MIME separators in crappy firmwares

David R Robison git at videolan.org
Mon Sep 2 17:40:56 CEST 2013


vlc | branch: master | David R Robison <drrobison at openroadsconsulting.com> | Mon Sep  2 18:40:05 2013 +0300| [5ad7967e01ac46fd1de0a1ca7af97004c07fd747] | committer: Rémi Denis-Courmont

mjpeg: work around broken MIME separators in crappy firmwares

Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5ad7967e01ac46fd1de0a1ca7af97004c07fd747
---

 modules/demux/mjpeg.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/modules/demux/mjpeg.c b/modules/demux/mjpeg.c
index 8def7f8..2c076ad 100644
--- a/modules/demux/mjpeg.c
+++ b/modules/demux/mjpeg.c
@@ -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;
         }



More information about the vlc-commits mailing list