From patchwork Sun Oct 15 00:13:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 44262 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4b15:b0:15d:8365:d4b8 with SMTP id fp21csp1811388pzb; Sat, 14 Oct 2023 17:13:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHbBlUXFWFF9KvrM6EJ/a7Z69Pq9Z8PWCrmwZNB5CHxK0ieuehWF5iGWSfmpreZYitqgFK/ X-Received: by 2002:a5d:5a91:0:b0:32d:8469:4f64 with SMTP id bp17-20020a5d5a91000000b0032d84694f64mr12896380wrb.18.1697328816638; Sat, 14 Oct 2023 17:13:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697328816; cv=none; d=google.com; s=arc-20160816; b=WxOsUzX52GQMS7hNKtsAiCZ8My59WqK0gmxtEP3X689Fho0wduPXwE87rfT1rgZplT jz0cDxALucYjs4FLi8LFueDUkSAbiTjltxInYqj41ZcQhI4r8ec/eouxeXLRBCY3qF1i GMwVB0Ht6CctNMZKR/byfUOlg1ywPhz7TPskbpaRrkNfKfg7Q4W5nqJw5qqXdbF3MtAV Vyr5kiWPGw/oFUZYgyGammbRE3gSiLv31VJil5Rx7U+IDE2dldD3hPoV5E3hQNMKbagn 53QKoawrHeqzrvbFDfywDRop/Mv0HQx7OTX4yj/qDSfZX4W+5ZIcy46KFKTI33ymYh82 o+rA== 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=/ur9dp4wAmps6atI/+eziWIIvHT9lhq4ppbEJxCFeI8=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=dOBNwGg0OC1xWmMDp5aR0Ne81ocAl1//xBl6Ix0tGdD1i9GhBxwIihoqX1hCeMUVvX VeMpL3q7sGUGu134rpjGJ7Fuun/A7a1LxG7zZ1BsCZ1jVL4F5FfKL6WOVgSfX/OGfeHy +P53e32PK2I/K4WfUKs35EfwvBsAwKsiCgl+xyphHpi4YxlDII4N08mevA/NENb2a9ii mOqVAY/hoMmq5ejcCfD7NcKFkbQOsYx6lqJ6pxR7ANndUirxKVJmxYe/lPfyC6iQoyrp KUPKCRr7mW5tnjKQBgSm78MnxLvCQOZUY+TjWRyz5C79WXk0t7F2Xu+7U0bvqYM0hjMn qZEw== 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 r17-20020aa7c151000000b005366c344d58si9990050edp.496.2023.10.14.17.13.35; Sat, 14 Oct 2023 17:13:36 -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 B07C268B460; Sun, 15 Oct 2023 03:13:31 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 264A868B460 for ; Sun, 15 Oct 2023 03:13:25 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 7C4C7240003 for ; Sun, 15 Oct 2023 00:13:24 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 15 Oct 2023 02:13:23 +0200 Message-Id: <20231015001323.1073-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH] avformat/mov: The iloc test is not redundant 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: 6vNMA4s9aByT Fixes: Assertion failure Fixes: 62866/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-5282997370486784 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, 2 insertions(+), 3 deletions(-) diff --git a/libavformat/mov.c b/libavformat/mov.c index 2f29487beb..34691d0cda 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -7788,11 +7788,10 @@ static int mov_read_iloc(MOVContext *c, AVIOContext *pb, MOVAtom atom) return 0; } - if (c->avif_info) { - av_log(c->fc, AV_LOG_INFO, "Duplicate iloc box found\n"); + if (c->avif_info || c->fc->nb_streams) { + av_log(c->fc, AV_LOG_INFO, "Duplicate or invalid iloc box found\n"); return 0; } - av_assert0(!c->fc->nb_streams); version = avio_r8(pb); avio_rb24(pb); // flags.