From patchwork Sun Jun 11 14:05:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timo Rothenpieler X-Patchwork-Id: 3906 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.10.195 with SMTP id 186csp512092vsk; Sun, 11 Jun 2017 07:06:42 -0700 (PDT) X-Received: by 10.28.23.9 with SMTP id 9mr5160711wmx.108.1497190002502; Sun, 11 Jun 2017 07:06:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497190002; cv=none; d=google.com; s=arc-20160816; b=NRLhUuTekEK/ZW4lY2WVzNcsrMo5n8iTCcucnepT+GcGbWFlvyKk3efTNuR643enQr AtjG2TTZmTkmaD04Z8yO9bH1iPyWE7OseS6M8VX4/RhOBhYcZfY651hVIGANOoLAh3yP Out5G+EjVq0aHpFmZgY+uNz6bi498zxIJVFICBjc1qlYSKpGVw6uOdr9N/3fqzaqcAtc oZ5H2lGwSRezLmAXF3HIJG9uVaJt1snP5UswTg5J4ntdUWM5D+a//HoX332X+bnDaZfp ek/dsXiswv4ujUG1dLKXt2c80/G4hUgW82l3bEWjEkUogky+1z+OkzFgb70XjAD7MYFj 1Pww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=LltLqQ3bwHFB+/xtvSk01nU6K13RcaC28++YyTLSWyI=; b=vziY9p8OsVLqI/s9W2MYOTiqyItNIIOEYhA5f29/XXPouq4523xWec/jeO6FBh7dEf Qt5Sl6ZlciJTA9X75SKZ7DfPY/SOahj5pewxP40NDa5QDqf0foiCKZq4l07kht+/n/sh /RQ5TMP6VRd5Asa0yTgXb5F8ctfYfFDfUBGX4IU6S+CJPSpLagkhwAee/pP+UZwPyy0Y 7hK1PTW1DJ1xSmOhAGrk8u07x2SmrHNeCZfSUmHxP9nlXwiPgb4rQwp71edIdKlXwqcU xvswR3hoN2oFHLDy1WKpfqxQPU+6i2krZuwJgpVeVwKFva/K+9A4sKe8VwYouACOsfpJ Rw1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@rothenpieler.org header.b=CoxDl4sl; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id g139si5170793wmd.134.2017.06.11.07.06.42; Sun, 11 Jun 2017 07:06:42 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@rothenpieler.org header.b=CoxDl4sl; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0BEA2689E1C; Sun, 11 Jun 2017 17:06:09 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from btbn.de (btbn.de [5.9.118.179]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CD2DF688262 for ; Sun, 11 Jun 2017 17:06:01 +0300 (EEST) Received: from localhost.localdomain (unknown [IPv6:2a02:8109:43f:959c:ba97:5aff:fe10:ec69]) by btbn.de (Postfix) with ESMTPSA id 06B5C6A516; Sun, 11 Jun 2017 16:06:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rothenpieler.org; s=mail; t=1497189963; bh=cQ1qzvCMNhl4eFcoDbpJMg257l0gDbAyxiC2G91ts+E=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=CoxDl4slbQC3uyMFyxNTpWZ119agoB+a91yyeO+2E7FViZHembDRwMlUSMAG5JEgw IV4KVx5F4gNBsbklcNejDDVLJ54WjjipIz9Dc5EuGuCOsndYFu/bWQ6SOfjP1db22V EMgAa+aGf3iQvMIzMzwoni4dnRf2g3mJIXfq5+Dc= From: Timo Rothenpieler To: ffmpeg-devel@ffmpeg.org Date: Sun, 11 Jun 2017 16:05:46 +0200 Message-Id: <20170611140551.11844-4-timo@rothenpieler.org> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170611140551.11844-1-timo@rothenpieler.org> References: <20170611140551.11844-1-timo@rothenpieler.org> Subject: [FFmpeg-devel] [PATCH 04/11] avformat/librtmp: check return value of setsockopt X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Timo Rothenpieler MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Fixes CID 1396837 --- libavformat/librtmp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavformat/librtmp.c b/libavformat/librtmp.c index 146df660ac..f3cfa9a8e2 100644 --- a/libavformat/librtmp.c +++ b/libavformat/librtmp.c @@ -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