From patchwork Sun Sep 22 21:56:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 51707 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:d154:0:b0:48e:c0f8:d0de with SMTP id bt20csp2134733vqb; Sun, 22 Sep 2024 14:57:17 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUIoL/4VDB8KQE9T5dEF6CqECS2ztUoyk7quD9vvhYBb0MJX5fP3caTztNL3dAxZJTtKzZOn+EOGsKQlv3eMWQB@gmail.com X-Google-Smtp-Source: AGHT+IHps5F1MDi+L4ZiIid8RnYNG37KbHD3Nn2b3IKbaOUTMDMB73MUqPh49cQq/gDWrs2xd37s X-Received: by 2002:a05:6402:3548:b0:5be:ee30:9948 with SMTP id 4fb4d7f45d1cf-5c464a3e20fmr7333371a12.8.1727042236808; Sun, 22 Sep 2024 14:57:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727042236; cv=none; d=google.com; s=arc-20240605; b=gOj1giSXDXR5tDnVzh7VDe1HZfmgF2r5AuNjuD5pRoqEpbhrdgy9R9zfBnUqBOqfRP z+2RNgWFNsw6GyA6Cgu8x2CwWrljQAEyolorG/fYdvtrlpWjIcq1gTKWGtaD78l1BNlU 2r8ou1C2NSeUqKd79fOnQ1fgXFPhnmhMRPF1IXPCUnKBuNpZNai3FtdBrqKQYFMblE+s gfEfD3gHNFoXftqpwzjWj9nAC8n0DnBY0pEtufH0XSTNfBf4J/XJyIdbMZJgy3oj6uiV 7MAowB1HDtkUqnW9vtUsLVvVdwUz9U611xdmffAgSQZ7NyhQa3LjZLHbo9e2i+aiVYQY ULAA== 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=oXxSaEsaKjKYG0XLMq2N7j5aqOw641JBmnVPC1pa7MM=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=JRu/iI2LLc9GlIywlogQMQ0dm0c/JejsU+LqUbCcBVDVgVxNFtmvn4+QmoqSFd0G0V mE3M72Ewo+HlCBP0hyGbYRdJHquweCfOnOhUvb/W/5l46p/lzFsuUIxmX6t569LgMVgh E/JtGQNoAtvLl8aVLJF6kRG/bsHPVnW/ZbwTYNO1gF8q1rTmqXbY2AbBuxEc9jt0R4IZ HgW9dtJ0+Ysnxljlx+vAuJrmZfJGfc4Hjs62F6TZwLy4D+4qoC7fWIsf8yFFJwseaa5N c4KhMxj8ftzBu097E+Qx9KnvQ2qJGwF8aDS8yTNOQqjClC5kPC4g3S9kvZ9j4WST1YXx gpYA==; 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=mzTv5JHC; 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 4fb4d7f45d1cf-5c42bb5b7eesi12187056a12.165.2024.09.22.14.57.16; Sun, 22 Sep 2024 14:57:16 -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=mzTv5JHC; 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 9217F68DB2F; Mon, 23 Sep 2024 00:56:56 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6122B68DB05 for ; Mon, 23 Sep 2024 00:56:49 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id B524440003 for ; Sun, 22 Sep 2024 21:56:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1727042208; 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=2u51omMTiw9Owo8bbYKO5sQzStk/Kfa6QYFK0Om34vw=; b=mzTv5JHC4ulbhSxIEUce50qJQZr1NMCgW2rq0ea6g7bntOAHsZXv4EPtg7TRDO5hiGEUFq O2EuqQ+j2HKplQeIUvcOMitvHP9W4ubUlMvQ3RVrDomsV07E3EifmqjV+CcWaWcn1NoZF6 sH7AqKS/GJIwbDDudlqPtscvECF2xOI8OGpP0mcIdIV/v/dsyZL8Ip61f6XZkIxz9RP9GX 1aQWUxDyRzu4iKal5HsmhWY7BhKQ2wgsGt3x2gVd86bDEi9xkamgwnkb4JVqyxQHWBj0SF k7QALRlTdMHLNgrbrcS58i5YeP+zLp3ZV+8zENxrzd82eYsiZ3sVUTGXDC5Pgw== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 22 Sep 2024 23:56:38 +0200 Message-ID: <20240922215645.1182935-3-michael@niedermayer.cc> X-Mailer: git-send-email 2.46.1 In-Reply-To: <20240922215645.1182935-1-michael@niedermayer.cc> References: <20240922215645.1182935-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 03/10] tools/target_swr_fuzzer: Limit the number of samples 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: verxPO4YAc3H Fixes: OOM and Timeout Fixes: 71254/clusterfuzz-testcase-minimized-ffmpeg_SWR_fuzzer-5941896977907712 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- tools/target_swr_fuzzer.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/target_swr_fuzzer.c b/tools/target_swr_fuzzer.c index b6cdb72a560..9192d4bed50 100644 --- a/tools/target_swr_fuzzer.c +++ b/tools/target_swr_fuzzer.c @@ -129,6 +129,9 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { in_sample_nb = size / (in_ch_count * av_get_bytes_per_sample(in_sample_fmt)); out_sample_nb = out_sample_nb % (av_rescale(in_sample_nb, 2*out_sample_rate, in_sample_rate) + 1); + if (in_sample_nb > 1000*1000 || out_sample_nb > 1000*1000) + goto end; + out_data = av_malloc(out_sample_nb * out_ch_count * av_get_bytes_per_sample(out_sample_fmt)); if (!out_data) goto end;