From patchwork Mon May 23 00:35:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 35892 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:9992:b0:82:461d:f3b with SMTP id ve18csp1682509pzb; Sun, 22 May 2022 17:36:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdCxE5VOjKG+EmShLEU3lJ2ItVWhxqJo9Qh40kUmc4yjrkCHoQnWImtRrl5XPORyf0Xb9U X-Received: by 2002:a17:906:180c:b0:6fe:9a3e:3d5b with SMTP id v12-20020a170906180c00b006fe9a3e3d5bmr16043275eje.202.1653266207400; Sun, 22 May 2022 17:36:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653266207; cv=none; d=google.com; s=arc-20160816; b=AU+Z4kvBd7g50NuKZjXEpMq2zlQGeH36bC3//h6tusMXfHRTsFrA6GyAbMrEUpLPOw jDr3fbSxIWChjtRoVtsoB7ApW1p6gff78dG2gJp4helPSWGgY5o/Cj4hNQLIM/5953je Ie6nFZDyhqsqOfEszHpOJyLd6JDws53Lo6PJzfTa6J36d7vb7m/wGccMNc3XVIRD+Ptf Bitnmmar0zm8SAgUjfWVVCIUF6eJRYDRfpjnf7xVa8a8/5mYeYsBGPymbeX19LXyjRfV bCM7EatvPONtBu6SID6g74X3Uvd156pifanK94JE2en0Zf7p1wMxVmmxHsrr6wGVfFjU Jf9Q== 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: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:delivered-to; bh=CU6untgBUQ36SZAtgfzSXXsis3UQtQqIgMIFWk3m6cQ=; b=oZTbaBiZA2ShHZ26n8H5WjjKoCIqge5JE/Te2FK4vMszZLv0oNosfN0Ef6JObjTd4C dLeZZpQdJY1+g1O659K7Z70EbCtEwd0HwAV1JuoCl5oKcOVX20wuhAH3yovkrq1D68mb MLGfZebidl0//ev16UHLB0r4TMl8gjbSQBXkCuwKkn2OmYoLcb/wxmz5eh3LXN+26inD Lui6WarX8NdIeoNmhW0QM+B3FJcn27zn0ZXkUHE3xTihhBo6KBLIqGwMDTBgecsA+914 5N9CWpXBHEi4HLxA5AD5PyaNU4DIbvE/wlDxlddsCa+G+3A4J/siLr/3uCREQuEsIehH fB1w== ARC-Authentication-Results: i=1; mx.google.com; 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 b8-20020a17090630c800b006f38a179611si13737445ejb.580.2022.05.22.17.36.47; Sun, 22 May 2022 17:36:47 -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; 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 1C01168B4D5; Mon, 23 May 2022 03:36:45 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-at03-1.mx.upcmail.net (vie01a-dmta-at03-1.mx.upcmail.net [62.179.121.151]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1B3F368B072 for ; Mon, 23 May 2022 03:36:38 +0300 (EEST) Received: from [172.31.216.235] (helo=vie01a-pemc-psmtp-pe12.mail.upcmail.net) by vie01a-dmta-at03.mx.upcmail.net with esmtp (Exim 4.92) (envelope-from ) id 1nsw3j-000789-7I for ffmpeg-devel@ffmpeg.org; Mon, 23 May 2022 02:36:31 +0200 Received: from ren-mail-psmtp-mg02. ([80.109.253.241]) by vie01a-pemc-psmtp-pe12.mail.upcmail.net with ESMTP id svyRnY0Aq8s8Usw3jnJ7Da; Mon, 23 May 2022 02:36:31 +0200 Received: from localhost ([213.47.68.29]) by ren-mail-psmtp-mg02. with ESMTP id sw2knxqh08eSWsw2knzLEW; Mon, 23 May 2022 02:35:30 +0200 X-Env-Mailfrom: michael@niedermayer.cc X-Env-Rcptto: ffmpeg-devel@ffmpeg.org X-SourceIP: 213.47.68.29 X-CNFS-Analysis: v=2.4 cv=KKE5sHJo c=1 sm=1 tr=0 ts=628ad6d3 a=2hcxjKEKjp0CzLx6oWAm4g==:117 a=2hcxjKEKjp0CzLx6oWAm4g==:17 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=GEAsPZ9sns4A:10 a=j7ELw__fPrBG-WjMLlMA:9 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 23 May 2022 02:35:29 +0200 Message-Id: <20220523003529.21527-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220523003529.21527-1-michael@niedermayer.cc> References: <20220523003529.21527-1-michael@niedermayer.cc> X-CMAE-Envelope: MS4wfO7U5GsfHl78sArUcJ4ZFnbDCWDXDd+YDiQ+HkCoRWNhRB+t+TSheDoCMU2oRkg+pdCdviZulX9+eHz2j7cVVGz3YFtlL1H8fVxz2gI26xHVDr92H8bS jXi7tG4gJBiPvBjDErVtfoMTrg2/VWFDWo9xaBELIFrF/l1LKUi0PtlvUHZJcK772YLOxeIUVcRcWQ== Subject: [FFmpeg-devel] [PATCH 2/2] avformat/sctp: close socket on errors X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: agBokYy6N6jx This is untested as i have no testcase Fixes: CID1302709 Signed-off-by: Michael Niedermayer --- libavformat/sctp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/sctp.c b/libavformat/sctp.c index b8e23653d2..9d9e90097e 100644 --- a/libavformat/sctp.c +++ b/libavformat/sctp.c @@ -282,6 +282,8 @@ fail: goto restart; } fail1: + if (fd >= 0) + closesocket(fd); ret = AVERROR(EIO); freeaddrinfo(ai); return ret;