[vlc-commits] commit: stream_filter/httplive.c: IV is supported in version 2 or higher ( Jean-Paul Saman )

git at videolan.org git at videolan.org
Tue Nov 2 11:15:13 CET 2010


vlc | branch: master | Jean-Paul Saman <jean-paul.saman at m2x.nl> | Tue Oct 26 18:31:46 2010 +0200| [16ef665d30414c58a8be66f3baf7fdad2707893a] | committer: Jean-Paul Saman 

stream_filter/httplive.c: IV is supported in version 2 or higher

IV attribute of tag #EXT-X-KEY was parsed for any version of the protocol.
However chapter "7. Protocol version compatibility" lists the IV tag being
protocol version 2 or higher. This patch restricts the IV attribute to version
2 or higher of the protocol.
(cherry picked from commit a07189f8187302417cc2b6741bf9ab8d8c3c6e4c)

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

 modules/stream_filter/httplive.c |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/modules/stream_filter/httplive.c b/modules/stream_filter/httplive.c
index 1a5cef0..9e61255 100644
--- a/modules/stream_filter/httplive.c
+++ b/modules/stream_filter/httplive.c
@@ -468,14 +468,22 @@ static void parse_Key(stream_t *s, hls_stream_t *hls, char *p_read)
     else if (strncasecmp(attr, "NONE", 4) == 0)
     {
         char *uri = parse_Attributes(p_read, "URI");
-        char *iv = parse_Attributes(p_read, "IV");
-        if ((iv != NULL) || (uri != NULL))
+        if (uri != NULL)
         {
-            msg_Err(s, "#EXT-X-KEY: URI and IV not expected");
+            msg_Err(s, "#EXT-X-KEY: URI not expected");
             p_sys->b_error = true;
-
+        }
+        free(uri);
+        /* IV is only supported in version 2 and above */
+        if (hls->version >= 2)
+        {
+            char *iv = parse_Attributes(p_read, "IV");
+            if (iv != NULL)
+            {
+                msg_Err(s, "#EXT-X-KEY: IV not expected");
+                p_sys->b_error = true;
+            }
             free(iv);
-            free(uri);
         }
     }
     else



More information about the vlc-commits mailing list