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 698124A123 for ; Mon, 22 Apr 2024 01:32:00 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 901B468D297; Mon, 22 Apr 2024 04:31:57 +0300 (EEST) Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4194C68D1A6 for ; Mon, 22 Apr 2024 04:31:51 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 9DF6C1C0002 for ; Mon, 22 Apr 2024 01:31:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1713749510; 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; bh=IG6yZrJyWRXJ0l3xHoFxoLCIHHGxZAia1XLihZJuCSs=; b=l2pkFrZ7HYAGlJ6P6xznzTjLC40WkpVBV8QY+MLTaQRSBsTKSvti5AK32JxVYxJqk4eEjL yNAF8shEXRMUBLMwkZkFzhmfIIaAsXfL+OWUFehvQpY64OAqDLGep3OcfF/Q4HnSkRJUf+ l4WpgJU/tzoNEqrKOF4puk7t3LpWlY8NBCetmTDnxtTheddre39ZoCN5gagxVYKICyH8F2 ceSMLwW10Q6bovGfsOejGY20b+41xJHwW9MmtRKn59NGQwGx6cFMgUT8YK+LhMw3AApfxu tcDgtnyqcwZnQZCYNqGONXvyTflOUi+D/tCXixWAwcnnj+Hovnx68xqHGyRg9w== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 22 Apr 2024 03:31:50 +0200 Message-Id: <20240422013150.458103-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH] avcodec/cbs_h2645: Check NAL space 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-by-reviewing: CID1419833 Untrusted loop bound Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavcodec/cbs_h2645.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavcodec/cbs_h2645.c b/libavcodec/cbs_h2645.c index fe2e383ff33..1a45d424bae 100644 --- a/libavcodec/cbs_h2645.c +++ b/libavcodec/cbs_h2645.c @@ -709,7 +709,11 @@ static int cbs_h2645_split_fragment(CodedBitstreamContext *ctx, start = bytestream2_tell(&gbc); for(i = 0; i < num_nalus; i++) { + if (bytestream2_get_bytes_left(&gbc) < 2) + return AVERROR_INVALIDDATA; size = bytestream2_get_be16(&gbc); + if (bytestream2_get_bytes_left(&gbc) < size) + return AVERROR_INVALIDDATA; bytestream2_skip(&gbc, size); } end = bytestream2_tell(&gbc); -- 2.25.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".