From patchwork Thu May 25 21:40:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 41827 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:c51c:b0:10c:5e6f:955f with SMTP id gm28csp865070pzb; Thu, 25 May 2023 14:40:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ55dDXIgFiv9AoRkSSE73niuTkSNVkImeL/V/nviULrDFgvKujog0TjdAWwgP5NLLNLT3p7 X-Received: by 2002:a17:907:2d1e:b0:969:9c0c:4c97 with SMTP id gs30-20020a1709072d1e00b009699c0c4c97mr2778825ejc.1.1685050833179; Thu, 25 May 2023 14:40:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685050833; cv=none; d=google.com; s=arc-20160816; b=JmY1MAokm7b2v7tAy2YLx1aMjqPXBVYjA8DTnbrDRLFvdXvk3OJGllFv4uvnfJKLx2 pSzfflOgiv5OtWbDBpCgCbAwuRghSlnmFCyzbVA37wuRLamydCgoHl/JpV8FrRg07OS+ xt5B0Eo2e1ESAVz6Usny6KLGmVJvTid5iZTQlOxy0sIC8CHsW9HqggEl9fkJIY9lhHOz g0moXxnohPWR7BUv8huFeBqQdmRFKZ+yd806GJxK0gonJ6hN3XAHQLJxtwS1Vm3Vvy6c Y/CqS/g8DC4p9tvBJvrlljsHUnTYe2VD9VyklcVccmtQ7RYV4nzJj3w9WFFVBEKRBIKZ E+3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:delivered-to; bh=J0a4n0pSwt+6L1byMoC35nKxdhIo3XebeLPzOZ+qrd4=; b=x69/zGJm2fRpHiHVXyDLx3UgslvU5Dtr/NJHec4akSBWhj/cYh/YB4OjL7lUU5G121 v4bWRxmn3VQXoWebPQN2yrl/JkCiBrQi4z6pyZ3vU4uzd5Q2/26dPOsmM374l5wl6p0E kzkcb0RT55mGFs0FI5oVrlrRrO2iSwQQOiEgDbLj6bjGWFu98oUdqRhIAgofqWrwdrAP o6mECTmaqiUjU8JPg5eK+f1L5VpqP1nod5S/8vNzo6a1EZYaPDik8PPRYz+4RoH5NJee rdvwlHTfjVT80dgMPrKSZYTiMyiSbWYT4T4B5E7Dgd69WDZ6KMEZBRoc+v5vpdFGax/h pEBQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id hr3-20020a1709073f8300b0094f39c6a9b1si2054774ejc.4.2023.05.25.14.40.32; Thu, 25 May 2023 14:40:33 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3EE1168C1B6; Fri, 26 May 2023 00:40:28 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 77A7F68BB8E for ; Fri, 26 May 2023 00:40:21 +0300 (EEST) X-GND-Sasl: michael@niedermayer.cc Received: by mail.gandi.net (Postfix) with ESMTPSA id A188020003 for ; Thu, 25 May 2023 21:40:20 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Thu, 25 May 2023 23:40:15 +0200 Message-Id: <20230525214019.29048-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 Subject: [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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 2RBHxKCZ8YJp 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; + } time -= 2082844800; /* seconds between 1904-01-01 and Epoch */ if ((int64_t)(time * 1000000ULL) / 1000000 != time) {