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 BE3524369D for ; Sat, 19 Nov 2022 12:40:18 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8A85968B851; Sat, 19 Nov 2022 14:40:16 +0200 (EET) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C09EC68B6B1 for ; Sat, 19 Nov 2022 14:40:10 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 0FA33240499 for ; Sat, 19 Nov 2022 13:40:10 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id NPW6LlheMkAl for ; Sat, 19 Nov 2022 13:40:09 +0100 (CET) Received: from lain.khirnov.net (lain.khirnov.net [IPv6:2001:67c:1138:4306::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "lain.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 68C3E2400F5 for ; Sat, 19 Nov 2022 13:40:09 +0100 (CET) Received: by lain.khirnov.net (Postfix, from userid 1000) id 80C871601B2; Sat, 19 Nov 2022 13:40:06 +0100 (CET) From: Anton Khirnov To: FFmpeg development discussions and patches In-Reply-To: <20221118210918.3169-1-michael@niedermayer.cc> References: <20221118210918.3169-1-michael@niedermayer.cc> Mail-Followup-To: FFmpeg development discussions and patches Date: Sat, 19 Nov 2022 13:40:06 +0100 Message-ID: <166886160649.26119.1991147855481578535@lain.khirnov.net> User-Agent: alot/0.8.1 MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH 1/4] avcodec/tiff: Ignore tile_count 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: Quoting Michael Niedermayer (2022-11-18 22:09:15) > Fixes: out of array access > Fixes: 52427/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-4849108968144896 > > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > Signed-off-by: Michael Niedermayer > --- > libavcodec/tiff.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c > index cde318d5e5..b962dce5a2 100644 > --- a/libavcodec/tiff.c > +++ b/libavcodec/tiff.c > @@ -994,7 +994,7 @@ static int dng_decode_tiles(AVCodecContext *avctx, AVFrame *frame, > tile_count_y = (s->height + s->tile_length - 1) / s->tile_length; > > /* Iterate over the number of tiles */ > - for (tile_idx = 0; tile_idx < s->tile_count; tile_idx++) { > + for (tile_idx = 0; tile_idx < tile_count_x * tile_count_y; tile_idx++) { Then why store tile_count at all? Seems to be it will just confuse future readers. If I'm reading the code correctly, the only other use of tile_count is in setting has_tile_bits, but that also checks is_tiled, which is set together with tile_count. -- Anton Khirnov _______________________________________________ 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".