]> git.sesse.net Git - vlc/commitdiff
mjpeg : remove optional quotes from MIME boundary
authorSébastien Escudier <sebastien-devel@celeos.eu>
Wed, 19 Jun 2013 20:43:49 +0000 (20:43 +0000)
committerSébastien Escudier <sebastien-devel@celeos.eu>
Wed, 19 Jun 2013 20:43:49 +0000 (20:43 +0000)
modules/demux/mjpeg.c

index 2ae4ec79d2cbecbe5b3f92e5968abcfe7592a029..8def7f809a298bb877d0b590d380d11b05cc79e4 100644 (file)
@@ -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 );