[FFmpeg-trac] #7395(avformat:open): DASH demuxing error "unterminated entity reference" due to ampersand in URL

FFmpeg trac at avcodec.org
Fri Feb 16 12:30:45 EET 2024


#7395: DASH demuxing error "unterminated entity reference" due to ampersand in URL
-------------------------------------+-------------------------------------
             Reporter:  Starchild    |                    Owner:  (none)
                 Type:  defect       |                   Status:  open
             Priority:  normal       |                Component:  avformat
              Version:  git-master   |               Resolution:
             Keywords:  dash         |               Blocked By:
  regression                         |
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
Comment (by paul31415):

 For anyone interested, this fixes the issue:

 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, escaped);
 +            xmlNodeSetContent(baseurl_nodes[i], escaped);
              updated = 1;
 +            xmlFree(escaped);
              xmlFree(text);
          }
      }
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/7395#comment:5>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list