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 9324F4873E for ; Sat, 16 Dec 2023 12:16:58 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 47D9C68D11B; Sat, 16 Dec 2023 14:16:31 +0200 (EET) Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A634468D08A for ; Sat, 16 Dec 2023 14:16:23 +0200 (EET) Received: by mail.gandi.net (Postfix) with ESMTPSA id DEB9360008 for ; Sat, 16 Dec 2023 12:16:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1702728983; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:in-reply-to:in-reply-to:references:references; bh=hqc0SoRe/ogCdZHwL3TZgQcx71ZKFOu64OJdPgbAW88=; b=BiOt4tNrQ54iXAD+ObhB/pVubvj2ZMwbPzh+5zXs0c2N/1WoM8mFCSODFz/gaT/kdxYtQW OnHpTtXNYKpASErc9PmgAoJpIKqwRih1otZhP+XTyciXkOiA2YXc/URzyGFaVW6mmJjhcs fyxJQkpoNrp3WGFrhQQDvq1+MgS72+JXgn9QwwkqVIxnoSn/5S6FXZiCg1JTja8Ye3mHOw zhiPYSU8AG8cuqLc+1B6L89QP5oIZPQlu7qUrNboZPGlo5MP6QFEAXqQCrgGGppxgFogA2 9iiwU0tfPba4dH/VSnmh6dAoK37zk1FNoxGEw82P3gjxZwerchudEWxGT68D/A== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sat, 16 Dec 2023 13:16:19 +0100 Message-Id: <20231216121619.19436-4-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231216121619.19436-1-michael@niedermayer.cc> References: <20231216121619.19436-1-michael@niedermayer.cc> X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 4/4] avformat/mov: do not set sign bit for chunk_offsets 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 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 - -7412889664301817824 cannot be represented in type 'long' Fixes: 64296/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6304027146846208 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavformat/mov.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libavformat/mov.c b/libavformat/mov.c index 30cf7a15b01..65c5c8c288c 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -2242,8 +2242,13 @@ static int mov_read_stco(MOVContext *c, AVIOContext *pb, MOVAtom atom) for (i = 0; i < entries && !pb->eof_reached; i++) sc->chunk_offsets[i] = avio_rb32(pb); else if (atom.type == MKTAG('c','o','6','4')) - for (i = 0; i < entries && !pb->eof_reached; i++) + for (i = 0; i < entries && !pb->eof_reached; i++) { sc->chunk_offsets[i] = avio_rb64(pb); + if (sc->chunk_offsets[i] < 0) { + av_log(c->fc, AV_LOG_WARNING, "Impossible chunk_offset\n"); + sc->chunk_offsets[i] = 0; + } + } else return AVERROR_INVALIDDATA; -- 2.17.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".