]> git.sesse.net Git - ffmpeg/commitdiff
avformat/dashdec: check the root url length
authorSteven Liu <lq@chinaffmpeg.org>
Mon, 17 Aug 2020 12:30:18 +0000 (20:30 +0800)
committerliuqi05 <liuqi05@kuaishou.com>
Tue, 20 Oct 2020 03:41:44 +0000 (11:41 +0800)
if the length of the root url is 0, unnecessary process the root_url

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
Signed-off-by: liuqi05 <liuqi05@kuaishou.com>
libavformat/dashdec.c

index c28bb07f448f8307a7f0c60b1d28390ccf546668..693fc7372be5273af347585d2930e1e185591282 100644 (file)
@@ -771,7 +771,7 @@ static int resolve_content_path(AVFormatContext *s, const char *url, int *max_ur
     size = strlen(root_url);
     isRootHttp = ishttp(root_url);
 
-    if (root_url[size - 1] != token) {
+    if (size > 0 && root_url[size - 1] != token) {
         av_strlcat(root_url, "/", size + 2);
         size += 2;
     }