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 895CC4A68B for ; Sat, 4 May 2024 23:52:11 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 28B0168D57B; Sun, 5 May 2024 02:52:09 +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 0FCDC68D56D for ; Sun, 5 May 2024 02:52:03 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 74DEB240004 for ; Sat, 4 May 2024 23:52:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1714866721; 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=liGWkLsiyQU0tiOIPxXOj6zoCdE0RgAHz9DfQdKCjCU=; b=iTqShImTa32sLf//kxu5pplAbQVmJU4nlLb7WIONTI0n20PbFRja5o26o4yPJ8oWmv27be BBL4oOOZWV4OZleFklnLuiuPopKGG6abQ5aeuiUvexwns1BlBFLMw1gT/OftI6VqlNlVd/ UAMh4nH0MmudAsPHKPYOy4epoHExFMfj0VjkotCy4S2iH+v2fixteKGzJ9xte5C7/pwKKm 18+H2fPfxzPH3zBcc99H74cK3evk6MRU+R/127bSOqmwR/UkxLX/WcXMV1TGP6zFvZUyAr qU/ssP88QorclROuvupUBO/UthxHdoxtkcC+ZXLXDjTjKMlJ4ApnBaJ2W+zYZQ== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 5 May 2024 01:51:59 +0200 Message-ID: <20240504235200.2875183-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.43.2 MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 1/2] avcodec/flac_parser: Assert that we do not overrun the link_penalty array 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: CID1454676 Out-of-bounds read Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavcodec/flac_parser.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/flac_parser.c b/libavcodec/flac_parser.c index 47904d515a6..d9c47801f83 100644 --- a/libavcodec/flac_parser.c +++ b/libavcodec/flac_parser.c @@ -518,6 +518,8 @@ static int check_header_mismatch(FLACParseContext *fpc, for (i = 0; i < FLAC_MAX_SEQUENTIAL_HEADERS && curr != child; i++) curr = curr->next; + av_assert0(i < FLAC_MAX_SEQUENTIAL_HEADERS); + if (header->link_penalty[i] < FLAC_HEADER_CRC_FAIL_PENALTY || header->link_penalty[i] == FLAC_HEADER_NOT_PENALIZED_YET) { FLACHeaderMarker *start, *end; -- 2.43.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".