Without this patch a user a bit absent-minded may not notice that the connection
doesn't work because port is missing.
---
 libavformat/tcp.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/libavformat/tcp.c b/libavformat/tcp.c
index 1d953e3..bdaab7f 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))
-- 
1.7.10

_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to