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 444564055B for ; Sun, 16 Jun 2024 23:09:03 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 848B468D74F; Mon, 17 Jun 2024 02:08:47 +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 EE6ED68D72A for ; Mon, 17 Jun 2024 02:08:35 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 26FF9FF806 for ; Sun, 16 Jun 2024 23:08:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1718579315; 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=SE9MdkIqjlBcwyQ06mlKRK0HPgeqrXuJtab3l2ITGP8=; b=Q6VHrjpe5bpRp9VAAUwKH2p/Fa+L4Xp3mkwUpJ1mGnf/7S8nWMINR51mVkbyTLtxpmsDFK pUMOkMbIO3uBS7u5tCHHxay4dOLNOtGTbzE/pFi2poc88mCXplDr/j/NHkEYVB8GjyEFHx 3dxRqE1BTWIGa3Aviujx7aXGTuMWBej9kHGsujJQTMBSL4jaycn0NxxSwHclo9JjH0ZSrD ujoDnceL8nHS9CCSaCugx1D2jimhYTtGsb9cUhOnYJwcyn1nnLmytxwkix0NO6YyuUZsrf 7lyIFJvR7/4e1QBu5/GTpKwH1lYmjZNP1g+F1nl3qo9HUx0UH/rKFTKvQLF60w== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 17 Jun 2024 01:08:25 +0200 Message-ID: <20240616230831.912377-3-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240616230831.912377-1-michael@niedermayer.cc> References: <20240616230831.912377-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 3/9] avformat/iamf_parse: Try to use less space after the 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: out of array access Fixes: 68584/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-6256656668229632 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavformat/iamf_parse.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavformat/iamf_parse.c b/libavformat/iamf_parse.c index 312090b247c..5c2ff6862a7 100644 --- a/libavformat/iamf_parse.c +++ b/libavformat/iamf_parse.c @@ -355,6 +355,9 @@ static int scalable_channel_layout_config(void *s, AVIOContext *pb, substream_count = avio_r8(pb); coupled_substream_count = avio_r8(pb); + if (substream_count + k > audio_element->nb_substreams) + return AVERROR_INVALIDDATA; + audio_element->layers[i].substream_count = substream_count; audio_element->layers[i].coupled_substream_count = coupled_substream_count; if (output_gain_is_present_flag) { -- 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".