Commit d41d6ef7bf for ffmpeg
commit d41d6ef7bf89de856908ca0f03870c3e81bb0046
Author: Kacper Michajłow <kasper93@gmail.com>
Date: Wed Oct 14 11:16:49 2026 +0200
avformat/dashdec: resolve relative URLs against the location after redirects
Use the location of the manifest as the base of relative BaseURL
elements and segment templates, as the hls demuxer does.
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
index 1fe12d1bf7..cf6e2ed98c 100644
--- a/libavformat/dashdec.c
+++ b/libavformat/dashdec.c
@@ -1310,6 +1310,12 @@ static int parse_manifest(AVFormatContext *s, const char *url, AVIOContext *in)
if (av_opt_get(in, "location", AV_OPT_SEARCH_CHILDREN, (uint8_t**)&c->base_url) < 0)
c->base_url = av_strdup(url);
+ if (!c->base_url) {
+ if (close_in)
+ ff_format_io_close(s, &in);
+ return AVERROR(ENOMEM);
+ }
+ url = c->base_url;
av_bprint_init(&buf, 0, INT_MAX); // xmlReadMemory uses integer bufsize