]> git.sesse.net Git - ffmpeg/commitdiff
sctp: add port missing error message
authorJordi Ortiz <nenjordi@gmail.com>
Tue, 24 Jul 2012 17:56:39 +0000 (19:56 +0200)
committerMartin Storsjö <martin@martin.st>
Wed, 25 Jul 2012 17:31:16 +0000 (20:31 +0300)
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>
libavformat/sctp.c

index 7bcb5ae0a9ffa8e3228dc37da0dcb2540cb87d24..b8ab63e7da0bdbb8d38956237288d508b2facba0 100644 (file)
@@ -170,8 +170,12 @@ static int sctp_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,"sctp") || port <= 0 || port >= 65536)
+    if (strcmp(proto, "sctp"))
         return AVERROR(EINVAL);
+    if (port <= 0 || port >= 65536) {
+        av_log(s, AV_LOG_ERROR, "Port missing in uri\n");
+        return AVERROR(EINVAL);
+    }
 
     s->max_streams = 0;
     p = strchr(uri, '?');