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 D791A468C0 for ; Tue, 25 Jul 2023 00:46:37 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E4E2D68C809; Tue, 25 Jul 2023 03:46:19 +0300 (EEST) Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BA19E68C7F9 for ; Tue, 25 Jul 2023 03:46:12 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 05659240003 for ; Tue, 25 Jul 2023 00:46:11 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Tue, 25 Jul 2023 02:46:09 +0200 Message-Id: <20230725004609.17750-3-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230725004609.17750-1-michael@niedermayer.cc> References: <20230725004609.17750-1-michael@niedermayer.cc> X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 3/3] avcodec/cbs_h2645: Avoid an unchecked bytesteram read 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 MIME-Version: 1.0 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: The unchecked read caused the 2nd subsequent tell call to move backward resulting in a negative length Fixes: assertion failure Fixes: 60276/clusterfuzz-testcase-minimized-ffmpeg_BSF_TRACE_HEADERS_fuzzer-5434126636023808 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/cbs_h2645.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/cbs_h2645.c b/libavcodec/cbs_h2645.c index 34c5d1d372..21c8bc76d5 100644 --- a/libavcodec/cbs_h2645.c +++ b/libavcodec/cbs_h2645.c @@ -695,7 +695,7 @@ static int cbs_h2645_split_fragment(CodedBitstreamContext *ctx, int nal_unit_type = bytestream2_get_byte(&gbc) & 0x1f; unsigned int num_nalus = 1; if(nal_unit_type != VVC_DCI_NUT && nal_unit_type != VVC_OPI_NUT) - num_nalus = bytestream2_get_be16u(&gbc); + num_nalus = bytestream2_get_be16(&gbc); start = bytestream2_tell(&gbc); for(i = 0; i < num_nalus; i++) { -- 2.17.1 _______________________________________________ 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".