aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Ross <pross@xvid.org>2012-07-22 20:51:53 +1000
committerMichael Niedermayer <michaelni@gmx.at>2012-07-22 16:26:43 +0200
commit1be55c82a5b0ec4c16ab3aba5667ca47f9f169ff (patch)
tree84b76e854ee315dbf95a05d5e5cf1fcb0bd5b961
parent21fb7ff35ba9b0a4df83bb3139a3f14e13cd29f9 (diff)
downloadffmpeg-1be55c82a5b0ec4c16ab3aba5667ca47f9f169ff.tar.gz
av_url_split: dont let '/' char whallop '?' char
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/utils.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index c437866d68..eef77d0d65 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -4076,7 +4076,7 @@ void av_url_split(char *proto, int proto_size,
char *path, int path_size,
const char *url)
{
- const char *p, *ls, *at, *col, *brk;
+ const char *p, *ls, *ls2, *at, *col, *brk;
if (port_ptr) *port_ptr = -1;
if (proto_size > 0) proto[0] = 0;
@@ -4098,8 +4098,11 @@ void av_url_split(char *proto, int proto_size,
/* separate path from hostname */
ls = strchr(p, '/');
+ ls2 = strchr(p, '?');
if(!ls)
- ls = strchr(p, '?');
+ ls = ls2;
+ else if (ls && ls2)
+ ls = FFMIN(ls, ls2);
if(ls)
av_strlcpy(path, ls, path_size);
else