Skip to content

Commit 748acfc

Browse files
committed
fix dash unterminated entity reference: debugly/fsplayer#7
1 parent db6d712 commit 748acfc

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
From aa792f13138a726d80df869f62ebf4769a851fef Mon Sep 17 00:00:00 2001
2+
From: qianlongxu <qianlongxu@gmail.com>
3+
Date: Tue, 6 May 2025 17:49:09 +0800
4+
Subject: [PATCH] fix dash file error "unterminated entity reference" due to
5+
ampersand in <baseurl> tag
6+
7+
---
8+
libavformat/dashdec.c | 4 +++-
9+
1 file changed, 3 insertions(+), 1 deletion(-)
10+
11+
diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
12+
index 1215407..0a6c46b 100644
13+
--- a/libavformat/dashdec.c
14+
+++ b/libavformat/dashdec.c
15+
@@ -804,8 +804,10 @@ static int resolve_content_path(AVFormatContext *s, const char *url, int *max_ur
16+
memset(p + 1, 0, strlen(p));
17+
}
18+
av_strlcat(tmp_str, text + start, tmp_max_url_size);
19+
- xmlNodeSetContent(baseurl_nodes[i], tmp_str);
20+
+ xmlChar *escaped = xmlEncodeSpecialChars(NULL, tmp_str);
21+
+ xmlNodeSetContent(baseurl_nodes[i], escaped);
22+
updated = 1;
23+
+ xmlFree(escaped);
24+
xmlFree(text);
25+
}
26+
}
27+
--
28+
2.39.5 (Apple Git-154)
29+

0 commit comments

Comments
 (0)