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 0A55348AED for ; Sun, 30 Jun 2024 23:13:47 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id F21EE68D6DF; Mon, 1 Jul 2024 02:13:22 +0300 (EEST) Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7BA0368CC21 for ; Mon, 1 Jul 2024 02:13:11 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id D71541C0005 for ; Sun, 30 Jun 2024 23:13:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1719789191; 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=Crcvpofb7cyXHsZaQtK1eGXgTUQB/0Ba0iKanjJN6BU=; b=NaDofCP/Bs9gzIkdeOORoVDDowBGhHaDRuxuR9EEJKE5pD4cA4NcGk+tlcOQHS/7ltumF/ eKA9eElSnwNPSP2Hwpn7F3OHvbCYOoiSpTQ7A+9/JFgS2/7I7MnrISdRoQeFCrvGIKKCYQ pmiu4twhW2S3CHRzunH5F5ieeUcmF+JO+f+lozy/SF1imatocpZkUHn+RT95D/XMXx3Q4G 91yboUGiWeQfJDhAZrLrrCPkqF1cLUvjX9+K1yRuwM7oQ0u8TQAm/yeX77z6AW9IhXc59v 0JhKLkGY2Rdj1i2Xaso/ZSY8KhT1z9/3QDEx3Ut5yIYeoRG3L41WAGXb4207NA== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 1 Jul 2024 01:12:43 +0200 Message-ID: <20240630231306.3779027-4-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240630231306.3779027-1-michael@niedermayer.cc> References: <20240630231306.3779027-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 04/11] tools/target_enc_fuzzer: A64MULTI encoder is very slow, check and adjust threshold 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: 69097/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_A64MULTI_fuzzer-5062757287264256 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- tools/target_enc_fuzzer.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/target_enc_fuzzer.c b/tools/target_enc_fuzzer.c index 0345595ada7..c4c2df93a9b 100644 --- a/tools/target_enc_fuzzer.c +++ b/tools/target_enc_fuzzer.c @@ -78,6 +78,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { uint32_t it = 0; uint64_t nb_samples = 0; AVDictionary *opts = NULL; + uint64_t ec_pixels = 0; if (!c) { #define ENCODER_SYMBOL0(CODEC) ff_##CODEC##_encoder @@ -93,6 +94,9 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { return 0; maxpixels = maxpixels_per_frame * maxiteration; + switch (c->p.id) { + case AV_CODEC_ID_A64_MULTI: maxpixels /= 65536; break; + } maxpixels_per_frame = FFMIN(maxpixels_per_frame , maxpixels); @@ -168,6 +172,10 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { frame->height = ctx->height; while (data < end && it < maxiteration) { + ec_pixels += (ctx->width + 32LL) * (ctx->height + 32LL); + if (ec_pixels > maxpixels) + goto maximums_reached; + res = av_frame_get_buffer(frame, 0); if (res < 0) error("Failed av_frame_get_buffer"); @@ -192,7 +200,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { av_packet_unref(avpkt); } - +maximums_reached: encode(ctx, NULL, avpkt); av_packet_unref(avpkt); -- 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".