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 DE78A4B696 for ; Tue, 11 Jun 2024 13:44:33 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0E1AF68D837; Tue, 11 Jun 2024 16:44:31 +0300 (EEST) Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id F187B68D69E for ; Tue, 11 Jun 2024 16:44:24 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 2BF311C0003 for ; Tue, 11 Jun 2024 13:44:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1718113464; 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; bh=PDtVj1IUJfnYdpQXPZMGCfVROalQAYNY9Y9HCTHsnPA=; b=RP1NSOFN/sOCpG/OBQfhicHD+0HOozqTHRHZiSpNCZ+e1wS10Bs/Qz8FkJm6ItF85tfMWf j3ynM87MRad7YRcwE/9wUtl9oHVDlzgI4+OuPQcExDmWmmV6WLdGHmDTxFV2DU5rZ137XL Xu//1U8lJwRcctnzsKe/TXthrTItzoQMhgrSqE8wy8pSp1Ao206hYcx5Zz8eSI3ceK+1Ij 3xehm0+5dXRHTMjv7ipWir52x/iqtowxkO7IRw+FCkV6n1SNrRR75u0BYYq4i5imUB/Nsl Kav+9Cr452gIcTxerFraTrjiFs+cUjNkL1M2Xmd06gV3TZDKBdfgcUJpvTT9hw== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Tue, 11 Jun 2024 15:44:19 +0200 Message-ID: <20240611134422.3172010-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 1/4] avfilter/af_aresample: 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: CID1503078 Resource leak Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavfilter/af_aresample.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavfilter/af_aresample.c b/libavfilter/af_aresample.c index d6bd77beb32..8ff2fe5973f 100644 --- a/libavfilter/af_aresample.c +++ b/libavfilter/af_aresample.c @@ -195,8 +195,11 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamplesref) av_frame_copy_props(outsamplesref, insamplesref); outsamplesref->format = outlink->format; ret = av_channel_layout_copy(&outsamplesref->ch_layout, &outlink->ch_layout); - if (ret < 0) + if (ret < 0) { + av_frame_free(&outsamplesref); + av_frame_free(&insamplesref); return ret; + } outsamplesref->sample_rate = outlink->sample_rate; if(insamplesref->pts != AV_NOPTS_VALUE) { -- 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".