[FFmpeg-cvslog] sctp: add port missing error message

Jordi Ortiz git at videolan.org
Wed Jul 25 22:13:30 CEST 2012


ffmpeg | branch: master | Jordi Ortiz <nenjordi at gmail.com> | Tue Jul 24 19:56:39 2012 +0200| [ecfff0e9929f399119437cd7113bad1cd968e8ea] | committer: Martin Storsjö

sctp: 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 at martin.st>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ecfff0e9929f399119437cd7113bad1cd968e8ea
---

 libavformat/sctp.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavformat/sctp.c b/libavformat/sctp.c
index 7bcb5ae..b8ab63e 100644
--- a/libavformat/sctp.c
+++ b/libavformat/sctp.c
@@ -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, '?');



More information about the ffmpeg-cvslog mailing list