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 72B144A021 for ; Sun, 16 Jun 2024 23:09:22 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 987BB68D759; Mon, 17 Jun 2024 02:08:49 +0300 (EEST) Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 45B2F68D73B for ; Mon, 17 Jun 2024 02:08:37 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 9FEA51C0004 for ; Sun, 16 Jun 2024 23:08:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1718579316; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Km/6HRHKchQdxKy69gG+w98g8XUYsbLPMVe+CxwgLsw=; b=En5tRABZzAPzG3CyePR/vLWfu4baXSowK9NLsJhoD8SsHYkcPRsDlrgfoWKMEE4dpnOU2v YlRX5X5owGf/IudLXb/x/DWjCi1e/lBPTRB6+/2peguJfLPiATQJ91vKmyF8jF8zjuHGmz vcSPR5kUy9T6+VllNILqN7Sfc32tKRaZRbxlrXV8bFLvvWQhsxlzoopliN2bF1gt67Xmxw hUOapeOxLZHw5kzusCwN+ohDumEu8Td4vyEvADZBnVjZ8laq/wQQiXYnPtcY2T2VR/jY+O Qlem9tNGmcMeX9oSHnaOeEy723gyaslotBlUnbcms0xebgOrQKsD4HkXB54V6A== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 17 Jun 2024 01:08:27 +0200 Message-ID: <20240616230831.912377-5-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240616230831.912377-1-michael@niedermayer.cc> References: <20240616230831.912377-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [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-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: 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) return AVERROR_INVALIDDATA; if (offset_type == 1) c->heif_item[i].is_idat_relative = 1; -- 2.45.2 _______________________________________________ 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".