From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 445EA4B650 for ; Mon, 10 Jun 2024 19:10:23 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8E39F68D7D1; Mon, 10 Jun 2024 22:10:08 +0300 (EEST) Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6116968D7AE for ; Mon, 10 Jun 2024 22:10:00 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 904721BF204 for ; Mon, 10 Jun 2024 19:09:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1718046599; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yXGE6XPURa+3pB3b5y7OzVm4gvcwZIU4jnOwpzHL0TE=; b=PRyqUTF+1ofDru+yAzW/Y/t47fiXanyf88WqoyvPqyqWN/GnYuojuyKstA/wIWwlG00vyE 5f2p7rG8mK9PLzZmbKtPpCxWzygmeq1O9+nUrL76nfaJjMuab0rRBBx60MUveyXqtQW0dI MGR19eGoPcbDeodzJjJYJatRQc04U/JXJLTZgdMk0lLV3rAWk1xmSoB4+WAfTK+GcmLRfz S9C1TUDRN8le9lwQS8yv5ndeg7sj1lXLjyXI0knZhkA920hscfMasXZObow57T+20iWn2R nfkd1To1qtu+ivVwcGG0YN5OC3P18OfMloNpUPBFpCXxt1Ay0wT5XoBp0dPscg== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 10 Jun 2024 21:09:56 +0200 Message-ID: <20240610190956.2615107-3-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240610190956.2615107-1-michael@niedermayer.cc> References: <20240610190956.2615107-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 3/3] avfilter/af_amerge: Cleanup on av_channel_layout_copy() failure 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Fixes: CID1503088 Resource leak Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavfilter/af_amerge.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavfilter/af_amerge.c b/libavfilter/af_amerge.c index 493c8521388..67c87d1d9e5 100644 --- a/libavfilter/af_amerge.c +++ b/libavfilter/af_amerge.c @@ -246,8 +246,11 @@ static int try_push_frame(AVFilterContext *ctx, int nb_samples) av_make_q(1, outlink->sample_rate), outlink->time_base); - if ((ret = av_channel_layout_copy(&outbuf->ch_layout, &outlink->ch_layout)) < 0) + if ((ret = av_channel_layout_copy(&outbuf->ch_layout, &outlink->ch_layout)) < 0) { + free_frames(s->nb_inputs, inbuf); + av_frame_free(&outbuf); return ret; + } while (nb_samples) { /* Unroll the most common sample formats: speed +~350% for the loop, -- 2.45.2 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".