From patchwork Sun Aug 1 19:30:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 29169 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:6c0f:0:0:0:0:0 with SMTP id a15csp1003370ioh; Sun, 1 Aug 2021 12:32:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzYz/pIQrl4wUTPgTG0P5xLvq2b2EnkC4OYhfrioFU9Hgl8RebYN6gilFjkKsBy3yJPbjik X-Received: by 2002:a17:906:b0c5:: with SMTP id bk5mr12148093ejb.428.1627846322938; Sun, 01 Aug 2021 12:32:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627846322; cv=none; d=google.com; s=arc-20160816; b=r7UstWWie3Y24VhFrPusKR6WMK6UC7+h6NKhAEDaQkM7+MrcCKPyMIUmk/5+jFB+TN alyRo7ENPpKc9ouW3SqAjFpdpJK0UFy+MM1jPBHeRh6YYvYoOnCpJKuvd3Tvnpl6Nfir H5mfFPwaFEApvAbMWpozPZHtCRz6IDO6oJmiDgrOCLSNTnXpD2ewmmyL9g57jsrwySFS jyLIz7S6l1rTqwNHLCJEbrZZ/WY8qDLmKy4qXoqysBKGOwbjNS0+8AMBWopy8628q5Xz FSfoPM+g9qH/72mJDbYEXX5SGgE7QpQPJeQLBLYE+mf3Bo+Ari3eH4P3B07Ko38HiBf/ cwtg== 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=VbncN010kl1kwF0usfCFpGAIMkx8ZE34HHm4VAURU40=; b=PUnddVEaRdLi2qCyxqJ4xs+nVdt8lppiwJI9CGgNCN2AeItD74FZ+pO06Dv7TfS9lO CKJa4qYw+SmWv8JngVvM/9goYFuZZ+w+GfKQBAIZ8ccFsOHRph/PwVMYFeQxfGhqG+aa uCg10cDlCTUUAvYn1Gn8sMfdXKQ2S1lFFMMYHB4strfC3GAJutA34prlDBcgVzSfTaoE 8F1HZmEhH7bHymx2hHz8N0uARWGODR/n6R4i+PPoiWK5ugdNr0TmlZQqzwDn4ZDS1Ss4 2QI2spliccKMzjg33GVKpuPKI0LQDp52lKEJ3ylywJWt3W5V2lXrdbXyE58S0lJ+PBtb zTnA== 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 e14si8679754ejj.279.2021.08.01.12.32.02; Sun, 01 Aug 2021 12:32:02 -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 9D51668A66B; Sun, 1 Aug 2021 22:31:40 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe03-3.mx.upcmail.net (vie01a-dmta-pe03-3.mx.upcmail.net [62.179.121.162]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0F14F68A5AC for ; Sun, 1 Aug 2021 22:31:32 +0300 (EEST) Received: from [172.31.216.235] (helo=vie01a-pemc-psmtp-pe12.mail.upcmail.net) by vie01a-dmta-pe03.mx.upcmail.net with esmtp (Exim 4.92) (envelope-from ) id 1mAHBL-004SDZ-0I for ffmpeg-devel@ffmpeg.org; Sun, 01 Aug 2021 21:31:31 +0200 Received: from localhost ([213.47.68.29]) by vie01a-pemc-psmtp-pe12.mail.upcmail.net with ESMTP id AHANmc4VNljeHAHANm7e7X; Sun, 01 Aug 2021 21:30:31 +0200 X-Env-Mailfrom: michael@niedermayer.cc X-Env-Rcptto: ffmpeg-devel@ffmpeg.org X-SourceIP: 213.47.68.29 X-CNFS-Analysis: v=2.3 cv=BoHjPrf5 c=1 sm=1 tr=0 a=2hcxjKEKjp0CzLx6oWAm4g==:117 a=2hcxjKEKjp0CzLx6oWAm4g==:17 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=GEAsPZ9sns4A:10 a=ZZnuYtJkoWoA:10 a=nZOtpAppAAAA:20 a=iVQhqdzlxWokygfra98A:9 a=1fhp2MxaeJtTNGEnv6mo:22 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 1 Aug 2021 21:30:28 +0200 Message-Id: <20210801193031.4094-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 X-CMAE-Envelope: MS4wfAhp1IYljDfyAUEk9xsry5Mu13r2EERgwUKUjHzwtM4t453XMC3GSerNJopgez6HVfjb7jIuM4VfbWkA297g3mRNM7VTdXMf+soB2gsZHyGvs8PEwxxI lZ8R/uMxGRHLr48DumFr214+i5M0Zj28Prw7vaBQdm/fzqDfSt6GsEla Subject: [FFmpeg-devel] [PATCH 1/4] tools/target_dec_fuzzer: check max samples in flush loop 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: Ua/FhdCFJCH8 Fixes: Timeout Fixes: 36020/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALS_fuzzer-4774629855068160 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- tools/target_dec_fuzzer.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/target_dec_fuzzer.c b/tools/target_dec_fuzzer.c index 0195d8910e..c0e59983c4 100644 --- a/tools/target_dec_fuzzer.c +++ b/tools/target_dec_fuzzer.c @@ -441,6 +441,10 @@ maximums_reached: got_frame = 0; av_frame_unref(frame); decode_handler(ctx, frame, &got_frame, avpkt); + + nb_samples += frame->nb_samples; + if (nb_samples > maxsamples) + break; } while (got_frame == 1 && it++ < maxiteration); fprintf(stderr, "pixels decoded: %"PRId64", samples decoded: %"PRId64", iterations: %d\n", ec_pixels, nb_samples, it);