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 ADDEC4AADF for ; Thu, 11 Jul 2024 23:37:38 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3BE3068DCCF; Fri, 12 Jul 2024 02:34:50 +0300 (EEST) Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2A5E468DBDD for ; Fri, 12 Jul 2024 02:34:35 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 6826620004 for ; Thu, 11 Jul 2024 23:34:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1720740875; 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=H2loFP8FdPsdgPEGbuvuurR0GKzRU0o17diAARow1ls=; b=HMRc4y1tLP/tdDRBsngsGUN45+nKIPqSlpJoqDY/9dK1EboBuxHJCc/fgvKE1hndeoesn3 cZreMa5i4nGdJKe29TSgL9d/fAoUjYGlRW4DtZu7AOJVgovMezHj85Lha9xUIKCk5ZHbww FZdHppH/obgJxBUMfJybP457dRPilqRzMt4cvOzE+ZVaeCNJe4ksU11K15EdwwE0tcfGjd ojIwIf1mxITFqdDF4slWCaOcJ7f4s1P3zeUoooRcvJXcSRbm400gT5ayufVsgbfKWNuAW8 CaT//gNHepBlhTUQyCjIsIyM+UOMf2jMdWM4W5qJK9O3R0a/QiQldbcQVmuA8g== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Fri, 12 Jul 2024 01:34:16 +0200 Message-ID: <20240711233417.1896879-22-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240711233417.1896879-1-michael@niedermayer.cc> References: <20240711233417.1896879-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 22/22] avfilter/vf_xfade: Check ff_inlink_consume_frame() for 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: CID1458043 Unchecked return value Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavfilter/vf_xfade.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/libavfilter/vf_xfade.c b/libavfilter/vf_xfade.c index e67a917d14f..e97117704a0 100644 --- a/libavfilter/vf_xfade.c +++ b/libavfilter/vf_xfade.c @@ -2288,8 +2288,11 @@ static int xfade_activate(AVFilterContext *avctx) // Check if we are not yet transitioning, in which case // just request and forward the input frame. if (s->start_pts > s->pts) { + int ret; s->passthrough = 1; - ff_inlink_consume_frame(in_a, &s->xf[0]); + ret = ff_inlink_consume_frame(in_a, &s->xf[0]); + if (ret < 0) + return ret; return ff_filter_frame(outlink, s->xf[0]); } s->passthrough = 0; @@ -2297,8 +2300,14 @@ static int xfade_activate(AVFilterContext *avctx) // We are transitioning, so we need a frame from second input if (ff_inlink_check_available_frame(in_b)) { int ret; - ff_inlink_consume_frame(avctx->inputs[0], &s->xf[0]); - ff_inlink_consume_frame(avctx->inputs[1], &s->xf[1]); + ret = ff_inlink_consume_frame(avctx->inputs[0], &s->xf[0]); + if (ret < 0) + return ret; + ret = ff_inlink_consume_frame(avctx->inputs[1], &s->xf[1]); + if (ret < 0) { + av_frame_free(&s->xf[0]); + return ret; + } // Calculate PTS offset to first input if (s->inputs_offset_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".