]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/sctp.c
asfenc: return error on negative timestamp
[ffmpeg] / libavformat / sctp.c
index 817b0049a990bfd81b21852863970b017237a889..b8ab63e7da0bdbb8d38956237288d508b2facba0 100644 (file)
@@ -39,8 +39,6 @@
 
 #include <netinet/in.h>
 #include <netinet/sctp.h>
-#include <sys/time.h>
-#include <unistd.h>
 
 #include "config.h"
 
@@ -172,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, '?');