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 7911948BD7 for ; Fri, 7 Jun 2024 13:05:48 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7C1DE68D7F4; Fri, 7 Jun 2024 16:04:04 +0300 (EEST) Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6B8CB68D77C for ; Fri, 7 Jun 2024 16:03:50 +0300 (EEST) Authentication-Results: mail1.khirnov.net; dkim=pass (2048-bit key; unprotected) header.d=khirnov.net header.i=@khirnov.net header.a=rsa-sha256 header.s=mail header.b=Nt+JnxyD; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 7A1E14E02 for ; Fri, 7 Jun 2024 15:03:49 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id yeWvAa1oSYea for ; Fri, 7 Jun 2024 15:03:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1717765422; bh=RFp6NoS2jinXUC+/qDOxdV9rJcJkfcAAWSDDZr1oQkA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Nt+JnxyDw6d5dD32dxLff6NYhRqgePKJQM3B+VpsHL/Z7D0an0qp6SkgaGrHmRAAO 5I9td6L8o0wNk3GcnZPxi/Ke8ib/pxZEEqhfX9LMOBUFC3uZBDIXkbz6Ek1caFXwzF av5+teWFoXWSn6n5pxY5wO3uMrxMbfUjQRWnr28EkelLOVI3VOk+JH5QGTmWW5yU/G zHxBh9TAshk8HrKk3V4v8RWs3NM+DtIsJurGw9fQ7liP6MBF3AOvoM/zDaKopBIhsE 0tGuMHsarK69BTphTfYiMyusDSFlbwwm0svRdKiTQCLXGX2rUdeQvpChynmLZjpAhf KNclfHI99Ip4w== Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail1.khirnov.net (Postfix) with ESMTPS id 062294DEE for ; Fri, 7 Jun 2024 15:03:41 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id F0E6D3A0D94 for ; Fri, 07 Jun 2024 15:03:34 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Fri, 7 Jun 2024 15:01:10 +0200 Message-ID: <20240607130135.9088-14-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240607130135.9088-1-anton@khirnov.net> References: <20240607130135.9088-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 14/39] lavc/hevcdec: only ignore INVALIDDATA in decode_nal_unit() 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: All other errors should cause a failure, regardless of the value of err_recognition. Also, print a warning message when skipping invalid NAL units. --- libavcodec/hevc/hevcdec.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c index d599373c9d..2c26d397df 100644 --- a/libavcodec/hevc/hevcdec.c +++ b/libavcodec/hevc/hevcdec.c @@ -3206,9 +3206,13 @@ static int decode_nal_unit(HEVCContext *s, const H2645NAL *nal) return 0; fail: - if (s->avctx->err_recognition & AV_EF_EXPLODE) - return ret; - return 0; + if (ret == AVERROR_INVALIDDATA && + !(s->avctx->err_recognition & AV_EF_EXPLODE)) { + av_log(s->avctx, AV_LOG_WARNING, + "Skipping invalid undecodable NALU: %d\n", s->nal_unit_type); + return 0; + } + return ret; } static int decode_nal_units(HEVCContext *s, const uint8_t *buf, int length) -- 2.43.0 _______________________________________________ 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".