[FFmpeg-cvslog] avformat/url: check the result of the strrchr
Steven Liu
git at videolan.org
Tue May 19 09:22:52 EEST 2020
ffmpeg | branch: master | Steven Liu <lq at chinaffmpeg.org> | Fri May 15 18:01:46 2020 +0800| [b707abf0911b1cb997bf8b1912c970e1e15996cf] | committer: Steven Liu
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 at kuaishou.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b707abf0911b1cb997bf8b1912c970e1e15996cf
---
libavformat/url.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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)
More information about the ffmpeg-cvslog
mailing list