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 A95CF4B4E8 for ; Sun, 7 Jul 2024 18:48:20 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C8F7B68DBEA; Sun, 7 Jul 2024 21:47:42 +0300 (EEST) Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 45A2768D933 for ; Sun, 7 Jul 2024 21:47:34 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id A58FAE0005 for ; Sun, 7 Jul 2024 18:47:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1720378053; 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=9xVNEn0+6qM2x9UXwoA/crPhSFQFDdlNTrvy5f15Op4=; b=N68RAI+s1rYdapY356fyGu7jwtuR+z2psvOXAvg0bHlJNjgseziv6ssGO7QFQPBSaAmiuz +2/KlZTvT4XYVkYtNMBKEgDPMDP5+QzTV8C+F9FRI/1YjMDfscdukrP+hLrk3A0/UsZINp 1WAoaGn1+Q06tsExFr9Kw+NPrqzmGAT+oKaRPkFAwJLQWcUCYvT7A2mf4bXhk5d0xF5O6O qQM896DwaVc9aqdnSH+euLjaW91MynbIi07LTd+3zLWozfFPUoLGOlXdo3gO0CUWILRdpC 5L0rUSlUe/WVExi/mn8pSenjFIv+1Q8wjrvsx/HKAB+bqx9PLdKXLOi85jXnAg== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 7 Jul 2024 20:47:28 +0200 Message-ID: <20240707184729.3525852-5-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240707184729.3525852-1-michael@niedermayer.cc> References: <20240707184729.3525852-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 5/6] avfilter: Free out on error 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: CID1197065 Resource leak Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavfilter/af_aderivative.c | 1 + libavfilter/vf_deshake.c | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/libavfilter/af_aderivative.c b/libavfilter/af_aderivative.c index eeaa23ff88d..4883972dcf1 100644 --- a/libavfilter/af_aderivative.c +++ b/libavfilter/af_aderivative.c @@ -126,6 +126,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) s->prev = ff_get_audio_buffer(inlink, 1); if (!s->prev) { av_frame_free(&in); + av_frame_free(&out); return AVERROR(ENOMEM); } } diff --git a/libavfilter/vf_deshake.c b/libavfilter/vf_deshake.c index 107b78a7d1c..05a2df652ee 100644 --- a/libavfilter/vf_deshake.c +++ b/libavfilter/vf_deshake.c @@ -478,8 +478,10 @@ static int filter_frame(AVFilterLink *link, AVFrame *in) aligned = !((intptr_t)in->data[0] & 15 | in->linesize[0] & 15); deshake->sad = av_pixelutils_get_sad_fn(4, 4, aligned, deshake); // 16x16, 2nd source unaligned - if (!deshake->sad) - return AVERROR(EINVAL); + if (!deshake->sad) { + ret = AVERROR(EINVAL); + goto fail; + } if (deshake->cx < 0 || deshake->cy < 0 || deshake->cw < 0 || deshake->ch < 0) { // Find the most likely global motion for the current frame -- 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".