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 4FA114055B for ; Sun, 16 Jun 2024 23:08:53 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E3A2068D745; Mon, 17 Jun 2024 02:08:44 +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 A933268D72A for ; Mon, 17 Jun 2024 02:08:35 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 3861D1C0003 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=1718579314; 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=+Zzr8M20JaTkZCamdJt5FZ7AB0t3DoBef6fivtyHVz0=; b=HHntTaxyE7vuw13ipbt/8k3U/QHBWMfJwAWx7/tY1T87m0aZmVJfFkzdYsEV6SZI6ulHgB tSKKghF813tHjtel23VE0agXe0WLc/pe1qOEjLoRkTNlZ899UAfnXyyj3dtEYAQWiAXy/w 9wwW4tpr7ct2aWSevUUUt5775pCp7JZGFBngMY4dnqF0ttmPCSrLMnJk8JGZPhfq4VuT+C zYFy6tR+UsKiLRHaA6LqVe+rsMf+F7eRxXdY16kCWGzqxhG9+OPfRCL9Pumm+39MsDL4NR ij8d5JXFhUiBGo3sNFLiRAqfCQIAz/wplldbd0IfaOu8JaJZjVxBeInNnRIVhg== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 17 Jun 2024 01:08:24 +0200 Message-ID: <20240616230831.912377-2-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 2/9] avcodec/mpeg4audio: Check that there is enough space for the first 3 elements in ff_mpeg4audio_get_config_gb() 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: 68863/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-4833546039525376 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/mpeg4audio.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavcodec/mpeg4audio.c b/libavcodec/mpeg4audio.c index fbd2a8f811a..ae18944f0d5 100644 --- a/libavcodec/mpeg4audio.c +++ b/libavcodec/mpeg4audio.c @@ -94,6 +94,10 @@ int ff_mpeg4audio_get_config_gb(MPEG4AudioConfig *c, GetBitContext *gb, { int specific_config_bitindex, ret; int start_bit_index = get_bits_count(gb); + + if (get_bits_left(gb) < 5+4+4) + return AVERROR_INVALIDDATA; + c->object_type = get_object_type(gb); c->sample_rate = get_sample_rate(gb, &c->sampling_index); c->chan_config = get_bits(gb, 4); -- 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".