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>
pull/338/head
Steven Liu 5 years ago
parent 9a8b984efa
commit b707abf091
  1. 2
      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 */ /* Remove the file name from the base url */
sep = strrchr(buf, '/'); sep = strrchr(buf, '/');
if (sep <= root) if (sep && sep <= root)
sep = root; sep = root;
if (sep) if (sep)

Loading…
Cancel
Save