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

David R Robison git at videolan.org
Mon Sep 2 17:48:49 CEST 2013


vlc/vlc-2.1 | branch: master | David R Robison <drrobison at openroadsconsulting.com> | Mon Sep  2 18:40:05 2013 +0300| [bd57353b0cf51461fe6147ae6ed3df667dc4b2e7] | committer: Jean-Baptiste Kempf

mjpeg: work around broken MIME separators in crappy firmwares

Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>
(cherry picked from commit 5ad7967e01ac46fd1de0a1ca7af97004c07fd747)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 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