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>
This commit is contained in:
Steven Liu 2020-05-15 18:01:46 +08:00
parent 9a8b984efa
commit b707abf091
1 changed files with 1 additions and 1 deletions

View File

@ -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)