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 6E6FF43F94 for ; Thu, 22 Sep 2022 13:01:15 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B82B968BBA1; Thu, 22 Sep 2022 16:01:12 +0300 (EEST) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 12FE668B7C8 for ; Thu, 22 Sep 2022 16:01:06 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id A0225240183 for ; Thu, 22 Sep 2022 15:01:05 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id aM290-pmanQD for ; Thu, 22 Sep 2022 15:01:05 +0200 (CEST) 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 2EEC72400F4 for ; Thu, 22 Sep 2022 15:01:05 +0200 (CEST) Received: by lain.khirnov.net (Postfix, from userid 1000) id 4F2091601B2; Thu, 22 Sep 2022 15:01:05 +0200 (CEST) From: Anton Khirnov To: FFmpeg development discussions and patches In-Reply-To: <20220918171410.31835-13-michael@niedermayer.cc> References: <20220918171410.31835-1-michael@niedermayer.cc> <20220918171410.31835-13-michael@niedermayer.cc> Mail-Followup-To: FFmpeg development discussions and patches Date: Thu, 22 Sep 2022 15:01:05 +0200 Message-ID: <166385166529.3205.838741980740358047@lain.khirnov.net> User-Agent: alot/0.8.1 MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH 13/13] avformat/westwood_vqa: Check chunk size 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-09-18 19:14:10) > Fixes: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int' > Fixes: 50993/clusterfuzz-testcase-minimized-ffmpeg_dem_WSVQA_fuzzer-6593408795279360 > > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > Signed-off-by: Michael Niedermayer > --- > libavformat/westwood_vqa.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/libavformat/westwood_vqa.c b/libavformat/westwood_vqa.c > index e3d2e2668c4..bd8df5e0b34 100644 > --- a/libavformat/westwood_vqa.c > +++ b/libavformat/westwood_vqa.c > @@ -274,6 +274,8 @@ static int wsvqa_read_packet(AVFormatContext *s, > return AVERROR(EIO); > > /* the decoder expects chunks to be 16-bit aligned */ > + if (wsvqa->vqfl_chunk_size == INT_MAX) > + return AVERROR_INVALIDDATA; IIUC this can only happen after the wsvqa->vqfl_chunk_size > 3 * (1 << 20) check above was triggered. Then it makes more sense to change that code to check chunk_size before setting wsvqa->vqfl_chunk_size. -- 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".