summaryrefslogtreecommitdiff
path: root/libavformat/url.c
diff options
context:
space:
mode:
authorSteven Liu <lq@chinaffmpeg.org>2020-05-15 18:01:46 +0800
committerSteven Liu <lq@chinaffmpeg.org>2020-05-19 14:22:34 +0800
commitb707abf0911b1cb997bf8b1912c970e1e15996cf (patch)
tree5ee0c1233cade6dc698f0ec44cbaee09c993c2eb /libavformat/url.c
parent9a8b984efaab2f13e4b81b6ede35fb02a853e4e7 (diff)
downloadffmpeg-b707abf0911b1cb997bf8b1912c970e1e15996cf.tar.gz
avformat/url: check the result of the strrchr
because it need be check for success, is should not change the old way if it failure. fix ticket: 8674 Signed-off-by: Steven Liu <liuqi05@kuaishou.com>
Diffstat (limited to 'libavformat/url.c')
-rw-r--r--libavformat/url.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/url.c b/libavformat/url.c
index 7cd9e0c705..6956f6dc10 100644
--- a/libavformat/url.c
+++ b/libavformat/url.c
@@ -182,7 +182,7 @@ void ff_make_absolute_url(char *buf, int size, const char *base,
/* Remove the file name from the base url */
sep = strrchr(buf, '/');
- if (sep <= root)
+ if (sep && sep <= root)
sep = root;
if (sep)