]> git.sesse.net Git - vlc/commitdiff
livehttp: parse key="value" style options
authorIlkka Ollakka <ileoo@videolan.org>
Wed, 11 Dec 2013 07:03:22 +0000 (09:03 +0200)
committerIlkka Ollakka <ileoo@videolan.org>
Thu, 12 Dec 2013 07:50:57 +0000 (09:50 +0200)
modules/stream_filter/httplive.c

index c4495795e853751c50ea880c8eff58514e1c54b6..050d782933d6fb0275f5788f87b43e6c2a5085a3 100644 (file)
@@ -496,9 +496,21 @@ static char *parse_Attributes(const char *line, const char *attr)
         if (strncasecmp(begin, attr, strlen(attr)) == 0
           && begin[strlen(attr)] == '=')
         {
-            /* <attr>=<value>[,]* */
+            /* <attr>="<value>"[,]* */
             p = strchr(begin, ',');
             begin += strlen(attr) + 1;
+
+            /* Check if we have " " marked value*/
+            if( begin[0] == '"' )
+            {
+                char *valueend = strchr( begin+1, '"');
+
+                /* No ending " so bail out */
+                if( unlikely( !valueend ) )
+                    return NULL;
+
+                p = strchr( valueend, ',');
+            }
             if (begin >= end)
                 return NULL;
             if (p == NULL) /* last attribute */