avformat/librtmp: check return value of setsockopt
authorTimo Rothenpieler <timo@rothenpieler.org>
Sun, 11 Jun 2017 13:08:43 +0000 (15:08 +0200)
committerTimo Rothenpieler <timo@rothenpieler.org>
Tue, 13 Jun 2017 17:48:08 +0000 (19:48 +0200)
Fixes CID 1396837

libavformat/librtmp.c

index 146df66..f3cfa9a 100644 (file)
@@ -239,7 +239,10 @@ static int rtmp_open(URLContext *s, const char *uri, int flags)
 #if CONFIG_NETWORK
     if (ctx->buffer_size >= 0 && (flags & AVIO_FLAG_WRITE)) {
         int tmp = ctx->buffer_size;
-        setsockopt(r->m_sb.sb_socket, SOL_SOCKET, SO_SNDBUF, &tmp, sizeof(tmp));
+        if (setsockopt(r->m_sb.sb_socket, SOL_SOCKET, SO_SNDBUF, &tmp, sizeof(tmp))) {
+            rc = AVERROR_EXTERNAL;
+            goto fail;
+        }
     }
 #endif