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 5688E472FC for ; Wed, 31 Jul 2024 19:55:03 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B6B1A68D910; Wed, 31 Jul 2024 22:54:26 +0300 (EEST) Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3FA3C68D8EA for ; Wed, 31 Jul 2024 22:54:16 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 999D11BF203 for ; Wed, 31 Jul 2024 19:54:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1722455655; 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=n6waCTR/W5Anaqn5bae/m0xLw2w+stlKIbnr+5MG8bE=; b=A+sWXh5HdYeCezkecxqDI+/qI/DPx42dYr+A/v06+ELGmznbcsk1a6U8FpBJGu5uLJcayQ uxzXUaQ2zu7KqK8ASb9VH8xxCcPoLoyDciYThpa6lgBFNo+3sBsA+mkm0drCjZn04UMafk ks9Yp5hLkYuIn5lG6u5d7nnZJ7xyjUY7j5WufXZwJgS+2Vth1BMdEYcJApnxYixIA1q8SZ uzbjoeMv0ueqlLXatwfwOTKUhxjUhsXq9OxloEF5JKDKK5V7t7tNmUvehu9SfjSEmGtizR x5cKLR5SXT1HeQkjdAcSbjX4XIV8LbXbQUlqohefbWmxioLHyVEGnMO051rZQQ== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Wed, 31 Jul 2024 21:54:10 +0200 Message-ID: <20240731195410.274508-6-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240731195410.274508-1-michael@niedermayer.cc> References: <20240731195410.274508-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 6/6] avcodec/snow: Fix off by 1 error in run_buffer 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: 70741/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SNOW_fuzzer-5703668010647552 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/snow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/snow.c b/libavcodec/snow.c index 0285362d439..af6214d0778 100644 --- a/libavcodec/snow.c +++ b/libavcodec/snow.c @@ -428,7 +428,7 @@ av_cold int ff_snow_common_init(AVCodecContext *avctx){ !FF_ALLOCZ_TYPED_ARRAY(s->spatial_dwt_buffer, width * height) || //FIXME this does not belong here !FF_ALLOCZ_TYPED_ARRAY(s->temp_dwt_buffer, width) || !FF_ALLOCZ_TYPED_ARRAY(s->temp_idwt_buffer, width) || - !FF_ALLOCZ_TYPED_ARRAY(s->run_buffer, ((width + 1) >> 1) * ((height + 1) >> 1))) + !FF_ALLOCZ_TYPED_ARRAY(s->run_buffer, ((width + 1) >> 1) * ((height + 1) >> 1) + 1)) return AVERROR(ENOMEM); for(i=0; i