1
0
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:
Hendi
2025-11-02 23:11:02 +01:00
committed by Marton Balint
parent 4c4ab2ec6f
commit b399896046

View File

@@ -780,7 +780,13 @@ static int resolve_content_path(AVFormatContext *s, const char *url, int *max_ur
}
root_url = (av_strcasecmp(baseurl, "")) ? baseurl : path;
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;
}
@@ -814,9 +820,15 @@ static int resolve_content_path(AVFormatContext *s, const char *url, int *max_ur
memset(p + 1, 0, strlen(p));
}
av_strlcat(tmp_str, text + start, tmp_max_url_size);
xmlNodeSetContent(baseurl_nodes[i], tmp_str);
updated = 1;
xmlFree(text);
xmlChar* escaped = xmlEncodeSpecialChars(NULL, tmp_str);
if (!escaped) {
updated = AVERROR(ENOMEM);
goto end;
}
xmlNodeSetContent(baseurl_nodes[i], escaped);
updated = 1;
xmlFree(escaped);
}
}