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 314AF4595B for ; Sun, 28 May 2023 18:54:10 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B9E8668C137; Sun, 28 May 2023 21:54:07 +0300 (EEST) Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2A4A0680068 for ; Sun, 28 May 2023 21:54:01 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id B56D7E8E58 for ; Sun, 28 May 2023 20:53:51 +0200 (CEST) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4pCItQQH_XLJ for ; Sun, 28 May 2023 20:53:50 +0200 (CEST) Received: from iq (iq [217.27.212.140]) by iq.passwd.hu (Postfix) with ESMTPS id 05573E8E53 for ; Sun, 28 May 2023 20:53:50 +0200 (CEST) Date: Sun, 28 May 2023 20:53:49 +0200 (CEST) From: Marton Balint To: FFmpeg development discussions and patches In-Reply-To: <20230525214019.29048-1-michael@niedermayer.cc> Message-ID: <9b48247-5fc5-7824-5da9-823d34919252@passwd.hu> References: <20230525214019.29048-1-michael@niedermayer.cc> MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH 1/5] avformat/mov: We do not support creation times of 300 billion years ago 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Thu, 25 May 2023, Michael Niedermayer wrote: > Fixes: signed integer overflow: -9223372036854775808 - 2082844800 cannot be represented in type 'long' > Fixes: 58384/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6428383700713472 > > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > Signed-off-by: Michael Niedermayer > --- > libavformat/mov.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/libavformat/mov.c b/libavformat/mov.c > index 9fdeef057e..3e2c4bc10d 100644 > --- a/libavformat/mov.c > +++ b/libavformat/mov.c > @@ -1530,6 +1530,10 @@ static void mov_metadata_creation_time(MOVContext *c, AVIOContext *pb, AVDiction > } > } > if (time) { > + if (time < INT64_MIN + 2082844800) { > + av_log(c->fc, AV_LOG_DEBUG, "creation_time predates big bang\n"); > + return; > + } Actually creation_time is unsigned, so it cannot be negative. I suggest you simply reject everyting less than 0 here. You should also move the check to the version == 1 case, because only that can read a "negative" value. Regards, Marton _______________________________________________ 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".