Message ID | 20240919225639.2376418-2-michael@niedermayer.cc |
---|---|
State | New |
Headers | show
Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:d154:0:b0:48e:c0f8:d0de with SMTP id bt20csp619955vqb; Thu, 19 Sep 2024 15:57:04 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUqjlzfneouJDnb6PjgsTfmoIHC3qZRWVAnqk97lSzuEj9Nl7/WsfAnLoXwIcgo4GqiEltlinVTX1MK0Tp0ub9c@gmail.com X-Google-Smtp-Source: AGHT+IGaN8PeKW25A3HsiIdYp2dpvl48PILAcIqExQguQutzgUzdLKiZKuKdCnF8KxHPh42fZKtu X-Received: by 2002:a2e:4e02:0:b0:2f5:11f6:1b24 with SMTP id 38308e7fff4ca-2f7cc36fa50mr2168751fa.18.1726786624016; Thu, 19 Sep 2024 15:57:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726786623; cv=none; d=google.com; s=arc-20240605; b=Zyl8bZ/+sA6Z315lTwXos1UcD2Ug4Kaix8qdk3G74KEj1SecUNVh3tfTc36Rrpg4VG pyOGeHTEYtjNHL+LSAPS5GtznwPUvhN6lWP94H4PaT3pxY4RSOXmAtRUd3RuuNrzl3JW 6wD32E7flBagQkE4bfdOeo4SZhnVTg41ClyD8CBTQojeSdK/Sg0ilY6ZjXg5oD7XWVn7 dpn0hSfcYdEsp5eh15q98XfsVJexmxarlrAzb1jL/fhjYO8fghNJWTBh28A5srobkNfa OQF9uk5H0z248tm0ziSX8BXIBOldbvEA2tIUq1cz1iAwXtjKjyK1QW8XJPsYSb1/HMEE 837g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=kV/FHpq/Yw6BRQtOZCmNYwsyfmg1t9EAzc5HYHL91To=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=AtHfcKIGmoY+/1bwODHycLss6lUz0qvQRcS1WWMBlJCaKhSRnoZiJXdYTZMjRQZLle I9aFFGs0cldCrIYyAiTNgPkCnS0qX3IFn5h/VQAMxBTmKaoh+0aGA2jKQRlxTT/tsMBz jkR6ZYagmKAat9BdF7y0zKnVOZXBRUH4CF2Kl0WtwfCH0x/tbMRPO0Uvq/pVkjFVyCaN RBR8wMD/XnldO/6ZFQ6Q4k5hB0a+O2mSDYZ9N4Chw49446th8f26ksMZcdiGN7HvbTf6 ClTcTHnuO5Ddk8od63vk9gGPRHOnib0T+gbDn2wdCYM3vx4F8PFZ8lLNY1hQ5kfgY/8s bBWw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@niedermayer.cc header.s=gm1 header.b="aCo/OpOh"; 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: <ffmpeg-devel-bounces@ffmpeg.org> Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 38308e7fff4ca-2f79d37d042si35689371fa.457.2024.09.19.15.57.03; Thu, 19 Sep 2024 15:57:03 -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; dkim=neutral (body hash did not verify) header.i=@niedermayer.cc header.s=gm1 header.b="aCo/OpOh"; 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 A7E5168DC7A; Fri, 20 Sep 2024 01:56:48 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1750A68B32F for <ffmpeg-devel@ffmpeg.org>; Fri, 20 Sep 2024 01:56:41 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 74AA820004 for <ffmpeg-devel@ffmpeg.org>; Thu, 19 Sep 2024 22:56:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1726786600; 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=Ncx4BUxTn/LsKjilt7blAzt8LYkJYzdOo9tjJM7V9tw=; b=aCo/OpOhSmjS4/1t/PTKkWB4SmuxxBgEO4ednRX+J1nBIwU4LdrejdQlM3ZJAT/NeAX2+Z /yYaOY1zhu0SEZwRiLj+sfQvj5C5p75kIXyPbL0IltDezew7u34u+Oxw3hNEUvIdJb8dwx C/jGjOOVy8itFdMRyd95RqGRHESCo8CaPvy+TTO2GhZlR20kUQBwFNtSgwLacp6hGoSNVo WdzESCtahyb+gbITZ/Ah136PFvOoxfSEhSsqpaJEJBxoij4vBq5ElJGPn6qJuId4ZFDIXo aOw33uQNwbo5Bhe1gGD9ZUwcGEgm/YA6mVE/9ZUXLhVekK2fyFSDLqcVr+gHEA== From: Michael Niedermayer <michael@niedermayer.cc> To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> Date: Fri, 20 Sep 2024 00:56:32 +0200 Message-ID: <20240919225639.2376418-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.46.1 In-Reply-To: <20240919225639.2376418-1-michael@niedermayer.cc> References: <20240919225639.2376418-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 2/9] avformat/asf: Check picsize X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches <ffmpeg-devel.ffmpeg.org> List-Unsubscribe: <https://ffmpeg.org/mailman/options/ffmpeg-devel>, <mailto:ffmpeg-devel-request@ffmpeg.org?subject=unsubscribe> List-Archive: <https://ffmpeg.org/pipermail/ffmpeg-devel> List-Post: <mailto:ffmpeg-devel@ffmpeg.org> List-Help: <mailto:ffmpeg-devel-request@ffmpeg.org?subject=help> List-Subscribe: <https://ffmpeg.org/mailman/listinfo/ffmpeg-devel>, <mailto:ffmpeg-devel-request@ffmpeg.org?subject=subscribe> Reply-To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" <ffmpeg-devel-bounces@ffmpeg.org> X-TUID: wkLFeB/nkUbu |
Series |
None
|
expand
|
diff --git a/libavformat/asf.c b/libavformat/asf.c index a71337aa3c9..5c118d2dbe0 100644 --- a/libavformat/asf.c +++ b/libavformat/asf.c @@ -90,8 +90,8 @@ static int asf_read_picture(AVFormatContext *s, int len) return 0; } - if (picsize >= len) { - av_log(s, AV_LOG_ERROR, "Invalid attached picture data size: %d >= %d.\n", + if (picsize >= len || ((int64_t)len - picsize) * 2 + 1 > INT_MAX) { + av_log(s, AV_LOG_ERROR, "Invalid attached picture data size: %d (len = %d).\n", picsize, len); return AVERROR_INVALIDDATA; }
Fixes: signed integer overflow: 1073750247 * 2 cannot be represented in type 'int' Fixes: 70722/clusterfuzz-testcase-minimized-ffmpeg_dem_ASF_O_fuzzer-5447231587549184 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> --- libavformat/asf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)