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 D124F4B89C for ; Tue, 18 Jun 2024 00:42:00 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0506868D7AF; Tue, 18 Jun 2024 03:41:57 +0300 (EEST) Received: from mail-ot1-f47.google.com (mail-ot1-f47.google.com [209.85.210.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3FB8068D5D4 for ; Tue, 18 Jun 2024 03:41:51 +0300 (EEST) Received: by mail-ot1-f47.google.com with SMTP id 46e09a7af769-6f9774a556cso2915441a34.0 for ; Mon, 17 Jun 2024 17:41:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718671308; x=1719276108; darn=ffmpeg.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=JaAv164bKT5fUnFSzxNmz/KwJykyEvO0NDokGva5Jns=; b=mPE/pvkVduljhYtP1OwQ0lFbcCmLYlHPyBcj1tZCRyYygEAweTbouori/jHzFgk0n3 Y7l6cKEm32aeOIjAllCg3qLMrSEZ/NWdQe1yOOx1juFf2g3SOO82L60R/0MUdwwaW9ap DQTBTbyDYFA73AuNSyfhdoPwhRRPY9ArgT+7L96x3aM/9CJzIRgM8eT/6Ls8fyKI+dDZ xLJFH4L5qxvSpJQP+aIiGobgsejfJDDoRwlyMTlCMktXF6o0FOHcCK6HJVJIri+7LdfZ qKqykjxkTXRcZkhKN/VZQUsxrYLamLp4i7EZISWAKTRzD+Iq/TI4vEgx5EmZzZZGuLfm WeUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718671308; x=1719276108; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=JaAv164bKT5fUnFSzxNmz/KwJykyEvO0NDokGva5Jns=; b=IsbWU+sEeclBD4CKXq9Hri2sG8FZeO00CUjXj1aPpvy851rA305P+MCTOIYw/CDcJK c5hFoEguvus82jtAR9J2TgdAzUbdY/yZKqyUzaQYdRswIwvv2AIvqklL5iUyKnsOph5i UXBQwIXyeNOQ7VY3b1EyDApt/Zx+o9uWgpPJZ2rYDsbzEURJsibJESq+Eu7nxYhHp4Se ZwcONEtQ/MQvN3xp2E7COQUUrVkBhLoYel2MbrJZ9482guizonuR7OC/kZZmmRafSwoq gypxb36edtX3zZZm2HCl4lna0gVWX94Y4bRAELlaU/+AS4WcqoZo79YnVDk8WRbdqqIL sYhw== X-Gm-Message-State: AOJu0YzXokrOMQWjEV3r8z12eb4aoBNQ1x5Kh8a20XWt08tcQJt/P2BI oehA11xDZhEQ/Miiiu8/x8pvEnpVjLXS1H5boBOQU8dwbXiEAdjSShbVHw== X-Google-Smtp-Source: AGHT+IGSJ/XBBrurApGyczStUYEzU4oxCFGei8iMCixrNq4YAN47FTeYHnqBROK5R/q9M+H3146BPQ== X-Received: by 2002:a05:6870:392a:b0:254:f00e:569c with SMTP id 586e51a60fabf-25842b79b2dmr12861334fac.46.1718671308116; Mon, 17 Jun 2024 17:41:48 -0700 (PDT) Received: from [192.168.0.16] ([190.194.167.233]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-705ccb419a3sm7932273b3a.119.2024.06.17.17.41.46 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 17 Jun 2024 17:41:47 -0700 (PDT) Message-ID: Date: Mon, 17 Jun 2024 21:41:49 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: ffmpeg-devel@ffmpeg.org References: <20240616230831.912377-1-michael@niedermayer.cc> <20240616230831.912377-5-michael@niedermayer.cc> Content-Language: en-US From: James Almer In-Reply-To: <20240616230831.912377-5-michael@niedermayer.cc> Subject: Re: [FFmpeg-devel] [PATCH 5/9] avformat/mov: Check extend and base offset 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 6/16/2024 8:08 PM, Michael Niedermayer wrote: > Fixes: signed integer overflow: 2314885530818453536 + 9151314442816847872 cannot be represented in type 'long' > Fixes: 68359/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6571950311800832 > > 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, 3 insertions(+), 1 deletion(-) > > diff --git a/libavformat/mov.c b/libavformat/mov.c > index 9016cd5ad08..46cbce98040 100644 > --- a/libavformat/mov.c > +++ b/libavformat/mov.c > @@ -8131,7 +8131,9 @@ static int mov_read_iloc(MOVContext *c, AVIOContext *pb, MOVAtom atom) > } > for (int j = 0; j < extent_count; j++) { > if (rb_size(pb, &extent_offset, offset_size) < 0 || > - rb_size(pb, &extent_length, length_size) < 0) > + rb_size(pb, &extent_length, length_size) < 0 || > + base_offset < 0 || extent_offset < 0 || > + base_offset + (uint64_t)extent_offset > INT64_MAX) You can do the negative value check directly in rb_size() instead. And I'd prefer the other check to be (base_offset > INT64_MAX - extent_offset). > return AVERROR_INVALIDDATA; > if (offset_type == 1) > c->heif_item[i].is_idat_relative = 1; _______________________________________________ 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".