You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-11-23 21:54:53 +02:00
avformat/dashdec: Fix urls with special characters in manifest
This was especially a problem with ampersands, which occur frequently as part of query parameters.
This commit is contained in:
@@ -780,7 +780,13 @@ static int resolve_content_path(AVFormatContext *s, const char *url, int *max_ur
|
|||||||
}
|
}
|
||||||
root_url = (av_strcasecmp(baseurl, "")) ? baseurl : path;
|
root_url = (av_strcasecmp(baseurl, "")) ? baseurl : path;
|
||||||
if (node) {
|
if (node) {
|
||||||
xmlNodeSetContent(node, root_url);
|
xmlChar *escaped = xmlEncodeSpecialChars(NULL, root_url);
|
||||||
|
if (!escaped) {
|
||||||
|
updated = AVERROR(ENOMEM);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
xmlNodeSetContent(node, escaped);
|
||||||
|
xmlFree(escaped);
|
||||||
updated = 1;
|
updated = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -814,9 +820,15 @@ static int resolve_content_path(AVFormatContext *s, const char *url, int *max_ur
|
|||||||
memset(p + 1, 0, strlen(p));
|
memset(p + 1, 0, strlen(p));
|
||||||
}
|
}
|
||||||
av_strlcat(tmp_str, text + start, tmp_max_url_size);
|
av_strlcat(tmp_str, text + start, tmp_max_url_size);
|
||||||
xmlNodeSetContent(baseurl_nodes[i], tmp_str);
|
|
||||||
updated = 1;
|
|
||||||
xmlFree(text);
|
xmlFree(text);
|
||||||
|
xmlChar* escaped = xmlEncodeSpecialChars(NULL, tmp_str);
|
||||||
|
if (!escaped) {
|
||||||
|
updated = AVERROR(ENOMEM);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
xmlNodeSetContent(baseurl_nodes[i], escaped);
|
||||||
|
updated = 1;
|
||||||
|
xmlFree(escaped);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user