You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
hls: handle crypto in the protocol checks
Fixes issue 5248
This commit is contained in:
@@ -594,12 +594,20 @@ static int open_url(AVFormatContext *s, AVIOContext **pb, const char *url,
|
|||||||
{
|
{
|
||||||
HLSContext *c = s->priv_data;
|
HLSContext *c = s->priv_data;
|
||||||
AVDictionary *tmp = NULL;
|
AVDictionary *tmp = NULL;
|
||||||
const char *proto_name = avio_find_protocol_name(url);
|
const char *proto_name = NULL;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
av_dict_copy(&tmp, opts, 0);
|
av_dict_copy(&tmp, opts, 0);
|
||||||
av_dict_copy(&tmp, opts2, 0);
|
av_dict_copy(&tmp, opts2, 0);
|
||||||
|
|
||||||
|
if (av_strstart(url, "crypto", NULL)) {
|
||||||
|
if (url[6] == '+' || url[6] == ':')
|
||||||
|
proto_name = avio_find_protocol_name(url + 7);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!proto_name)
|
||||||
|
proto_name = avio_find_protocol_name(url);
|
||||||
|
|
||||||
if (!proto_name)
|
if (!proto_name)
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
|
|
||||||
@@ -608,6 +616,8 @@ static int open_url(AVFormatContext *s, AVIOContext **pb, const char *url,
|
|||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
if (!strncmp(proto_name, url, strlen(proto_name)) && url[strlen(proto_name)] == ':')
|
if (!strncmp(proto_name, url, strlen(proto_name)) && url[strlen(proto_name)] == ':')
|
||||||
;
|
;
|
||||||
|
else if (av_strstart(url, "crypto", NULL) && !strncmp(proto_name, url + 7, strlen(proto_name)) && url[7 + strlen(proto_name)] == ':')
|
||||||
|
;
|
||||||
else if (strcmp(proto_name, "file") || !strncmp(url, "file,", 5))
|
else if (strcmp(proto_name, "file") || !strncmp(url, "file,", 5))
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user