Skip to content

[patch]fix dash file error "unterminated entity reference" due to ampersand in <baseurl> tag #7

@m3u8playlist

Description

@m3u8playlist
diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
index 9ae28491e1ecd..41311d6e8f931 100644
--- a/libavformat/dashdec.c
+++ b/libavformat/dashdec.c
@@ -805,8 +805,10 @@ 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);
+            xmlChar *escaped = xmlEncodeSpecialChars(NULL, tmp_str);
+            xmlNodeSetContent(baseurl_nodes[i], escaped);
             updated = 1;
+            xmlFree(escaped);
             xmlFree(text);
         }
     }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions