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 B2ABB4B380 for ; Fri, 5 Jul 2024 00:23:02 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6371C68DAF7; Fri, 5 Jul 2024 03:22:20 +0300 (EEST) Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E16BA68DAD1 for ; Fri, 5 Jul 2024 03:22:01 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 496D7FF804 for ; Fri, 5 Jul 2024 00:22:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1720138921; 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=2ruXtfqzpnmwdBotLpBRhcE6u2pEu1FAWDBvjrVNYgM=; b=CT/UKiutzE10yagoX/JJy7WAYrqr2p0Wcl88Y4Shd/H0fBom1xocUPJQe0/CczMLyFA0ak CMW+bYymgI8xxxAUc5Rq59EUQCKceJ/o5LSqPRIMp9sTHmxWUEoLZIPolQCDhiVWDtVU5i S5mNSRfAIWFuF6hFjTNoAuFw3TiaBK0EBBNZDWodmvhEd0JQRCn2IP+qRHqg07UC+UpjKT UjLAdn192HyMbTa2NPvTLghyXGBfoXdm+3QNkUAjoy88SyWYB5Lgs/eSC5336t0hf8kNzU cowAaK3LbTcarZXDfb4BZG4Uar86TcbjMaPnZKNYpltHY864NwSg5Kj+HtyE5g== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Fri, 5 Jul 2024 02:21:47 +0200 Message-ID: <20240705002156.1964272-6-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240705002156.1964272-1-michael@niedermayer.cc> References: <20240705002156.1964272-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 06/15] avcodec/hw_base_encode: Simplify EOF check 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: Found while reviewing CID1608712 Explicit null dereferenced Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavcodec/hw_base_encode.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libavcodec/hw_base_encode.c b/libavcodec/hw_base_encode.c index ecb4be6aa43..6d5632c2988 100644 --- a/libavcodec/hw_base_encode.c +++ b/libavcodec/hw_base_encode.c @@ -546,11 +546,10 @@ start: } err = ff_encode_get_frame(avctx, frame); - if (err < 0 && err != AVERROR_EOF) - return err; - - if (err == AVERROR_EOF) + if (err == AVERROR_EOF) { frame = NULL; + } else if (err < 0) + return err; err = hw_base_encode_send_frame(avctx, ctx, frame); if (err < 0) -- 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".