Browse Source

avformat/url: check return value of strchr

fix ticket: 8687
workflow should return if there have no value of strchr

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
tags/n4.4
Steven Liu 5 years ago
parent
commit
029ff31af6
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      libavformat/url.c

+ 5
- 0
libavformat/url.c View File

@@ -90,6 +90,8 @@ static void trim_double_dot_url(char *buf, const char *rel, int size)
if (p && (sep = strstr(p, "://"))) {
sep += 3;
root = strchr(sep, '/');
if (!root)
return;
}

/* set new current position if the root node is changed */
@@ -150,6 +152,7 @@ void ff_make_absolute_url(char *buf, int size, const char *base,
}
/* If rel actually is an absolute url, just copy it */
if (!base || strstr(rel, "://") || rel[0] == '/') {
memset(buf, 0, size);
trim_double_dot_url(buf, rel, size);
return;
}
@@ -177,6 +180,8 @@ void ff_make_absolute_url(char *buf, int size, const char *base,
if (sep) {
sep += 3;
root = strchr(sep, '/');
if (!root)
return;
}
}



Loading…
Cancel
Save