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 B10694BC96 for ; Tue, 16 Jul 2024 13:19:39 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 02E9E68D9FF; Tue, 16 Jul 2024 16:19:38 +0300 (EEST) Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2630B68D857 for ; Tue, 16 Jul 2024 16:19:31 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 8462D1BF20C for ; Tue, 16 Jul 2024 13:19:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1721135970; 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; bh=SqYmu7xrcak+jx45Cy/hQb04mF3vBMv/y8IssppRBrY=; b=dt5ODWj7tdxqUpLHPUXxRwCM4cYr9C3dagBDT8ZzeHyDI3wot142JIMp2Ld1hcx6f0Wexx 77i+8giqIpJtZhk/vzi/s+uiuwEDzd9kgCKg8rZ+hihkqYmDQacIZ8IO45KZvv3YeRuFaD /Ok0LSfLKEIfQgp5pNTLr9525odEnVftRpXLpquqv/s/x140NKTuf2b55NQVsrMwoz8Dmx FTL2TlupWr283DAXFinwZ1IxAaZZlKvEJSWOiLYP4ErFnbiKe9Ornlxfw6Fr8gBwLHmnT+ oMdrgK+CR9EPd8IL1bwam6KuJFpS+9wlp/rXy3iaUDRzU704a1xll+cTCUSAMA== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Tue, 16 Jul 2024 15:19:29 +0200 Message-ID: <20240716131929.3708881-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH] avformat/mov: sanity check count in IPRP 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: Timeout Fixes: 69230/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-6540512101203968 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavformat/mov.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libavformat/mov.c b/libavformat/mov.c index ce95842ce58..9042753d221 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -8925,6 +8925,11 @@ static int mov_read_iprp(MOVContext *c, AVIOContext *pb, MOVAtom atom) flags = avio_rb24(pb); count = avio_rb32(pb); + if (count * 5LL > a.size) { + ret = AVERROR_INVALIDDATA; + goto fail; + } + for (int i = 0; i < count; i++) { int item_id = version ? avio_rb32(pb) : avio_rb16(pb); int assoc_count = avio_r8(pb); -- 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".