[vlc-commits] mjpeg : remove optional quotes from MIME boundary

Sébastien Escudier git at videolan.org
Wed Jun 19 22:58:00 CEST 2013


vlc | branch: master | Sébastien Escudier <sebastien-devel at celeos.eu> | Wed Jun 19 20:43:49 2013 +0000| [fbb82370e75217bbb3a449d884b95091e9aaa59b] | committer: Sébastien Escudier

mjpeg : remove optional quotes from MIME boundary

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

 modules/demux/mjpeg.c |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/modules/demux/mjpeg.c b/modules/demux/mjpeg.c
index 2ae4ec7..8def7f8 100644
--- a/modules/demux/mjpeg.c
+++ b/modules/demux/mjpeg.c
@@ -322,7 +322,15 @@ static int Open( vlc_object_t * p_this )
         char* boundary = strstr( content_type, "boundary=" );
         if( boundary )
         {
-            p_sys->psz_separator = strdup( boundary + strlen("boundary=") );
+	    boundary += strlen( "boundary=" );
+	    size_t len = strlen( boundary );
+	    if( len > 2 && boundary[0] == '"'
+	        && boundary[len-1] == '"' )
+	    {
+	        boundary[len-1] = '\0';
+	        boundary++;
+	    }
+            p_sys->psz_separator = strdup( boundary );
             if( !p_sys->psz_separator )
             {
                 free( content_type );



More information about the vlc-commits mailing list