Commit 16ef665d authored by Jean-Paul Saman's avatar 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 a07189f8)
parent 44d885bb
...@@ -468,14 +468,22 @@ static void parse_Key(stream_t *s, hls_stream_t *hls, char *p_read) ...@@ -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) else if (strncasecmp(attr, "NONE", 4) == 0)
{ {
char *uri = parse_Attributes(p_read, "URI"); char *uri = parse_Attributes(p_read, "URI");
char *iv = parse_Attributes(p_read, "IV"); if (uri != NULL)
if ((iv != NULL) || (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; 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(iv);
free(uri);
} }
} }
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment