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)