summaryrefslogtreecommitdiff
path: root/libavformat/tcp.c
diff options
context:
space:
mode:
authorJordi Ortiz <nenjordi@gmail.com>2012-07-24 19:59:53 +0200
committerMartin Storsjö <martin@martin.st>2012-07-25 20:30:39 +0300
commitf9a9a148622530cb02dbb81b31d951785f6d331a (patch)
tree4223e611498ebbbec5dc9a14ccc0218c1d278973 /libavformat/tcp.c
parent49c45a26244cee7594b3530c1d8975ce13d6b8f0 (diff)
tcp: add port missing error message
Without this patch a user a bit absent-minded may not notice that the connection doesn't work because the port is missing. Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat/tcp.c')
-rw-r--r--libavformat/tcp.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libavformat/tcp.c b/libavformat/tcp.c
index 1d953e3a11..bdaab7f806 100644
--- a/libavformat/tcp.c
+++ b/libavformat/tcp.c
@@ -49,9 +49,12 @@ static int tcp_open(URLContext *h, const char *uri, int flags)
av_url_split(proto, sizeof(proto), NULL, 0, hostname, sizeof(hostname),
&port, path, sizeof(path), uri);
- if (strcmp(proto,"tcp") || port <= 0 || port >= 65536)
+ if (strcmp(proto, "tcp"))
return AVERROR(EINVAL);
-
+ if (port <= 0 || port >= 65536) {
+ av_log(h, AV_LOG_ERROR, "Port missing in uri\n");
+ return AVERROR(EINVAL);
+ }
p = strchr(uri, '?');
if (p) {
if (av_find_info_tag(buf, sizeof(buf), "listen", p))