avformat/hlsenc: compare without the last directory separator in get_relative_url
authorSteven Liu <lq@chinaffmpeg.org>
Fri, 10 Jan 2020 14:51:22 +0000 (22:51 +0800)
committerSteven Liu <lq@chinaffmpeg.org>
Mon, 20 Jan 2020 06:23:56 +0000 (14:23 +0800)
fix ticket: 8461
there is no problem before commit 75aea52a1051a22bdebd0b7a8098ac6479a529a0

Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
libavformat/hlsenc.c

index d130f03..e87f08b 100644 (file)
@@ -1234,7 +1234,7 @@ static const char* get_relative_url(const char *master_url, const char *media_ur
     if (!p) p = strrchr(master_url, '\\');
 
     if (p) {
-        base_len = p + 1 - master_url;
+        base_len = p - master_url;
         if (av_strncasecmp(master_url, media_url, base_len)) {
             av_log(NULL, AV_LOG_WARNING, "Unable to find relative url\n");
             return NULL;