From patchwork Sun Dec 29 23:38:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 17050 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 28B73449027 for ; Mon, 30 Dec 2019 01:41:53 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0FE1B68AD18; Mon, 30 Dec 2019 01:41:53 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe06-3.mx.upcmail.net (vie01a-dmta-pe06-3.mx.upcmail.net [84.116.36.16]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BFB4168AD08 for ; Mon, 30 Dec 2019 01:41:44 +0200 (EET) Received: from [172.31.216.235] (helo=vie01a-pemc-psmtp-pe12.mail.upcmail.net) by vie01a-dmta-pe06.mx.upcmail.net with esmtp (Exim 4.92) (envelope-from ) id 1iliBs-0000Yi-1y for ffmpeg-devel@ffmpeg.org; Mon, 30 Dec 2019 00:41:44 +0100 Received: from localhost ([213.47.68.29]) by vie01a-pemc-psmtp-pe12.mail.upcmail.net with ESMTP id liAuiW8PZwlysliAuisoX4; Mon, 30 Dec 2019 00:40:44 +0100 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=E5OzWpVl c=1 sm=1 tr=0 a=2hcxjKEKjp0CzLx6oWAm4g==:117 a=2hcxjKEKjp0CzLx6oWAm4g==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=GEAsPZ9sns4A:10 a=ZZnuYtJkoWoA:10 a=WY3f1E3mFTQ1UJGGnE8A:9 a=pHzHmUro8NiASowvMSCR:22 a=Ew2E2A-JSTLzCXPT_086:22 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 30 Dec 2019 00:38:19 +0100 Message-Id: <20191229233819.17510-3-michael@niedermayer.cc> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191229233819.17510-1-michael@niedermayer.cc> References: <20191229233819.17510-1-michael@niedermayer.cc> MIME-Version: 1.0 X-CMAE-Envelope: MS4wfCXf2mKk2xQsxgcLBL8td0Colfcinwdqa+EBntQ7997x3fkggGyGRbxZozeshCrW+SMLDkYzV8Qz0c0jFz40matx1RX7I/Ty7I9IsR21jO1L9hb16vXD HvH3nwl0mDesnNbzLbh4jJAIGlxwlWkRAl8HgnrARNd1iq9DSaITxdSe Subject: [FFmpeg-devel] [PATCH 3/3] tools/target_dec_fuzzer: Use codec_tags list X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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" This should make it much quicker for the fuzzer to test real relevant codec_tags Signed-off-by: Michael Niedermayer --- tools/target_dec_fuzzer.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/target_dec_fuzzer.c b/tools/target_dec_fuzzer.c index c6e1235ad3..b9e08f74d2 100644 --- a/tools/target_dec_fuzzer.c +++ b/tools/target_dec_fuzzer.c @@ -212,6 +212,11 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { ctx->channels = (unsigned)bytestream2_get_le32(&gbc) % FF_SANE_NB_CHANNELS; ctx->block_align = bytestream2_get_le32(&gbc) & 0x7FFFFFFF; ctx->codec_tag = bytestream2_get_le32(&gbc); + if (c->codec_tags) { + int n; + for (n = 0; c->codec_tags[n] != CODEC_TAGS_END; n++); + ctx->codec_tag = c->codec_tags[ctx->codec_tag % n]; + } keyframes = bytestream2_get_le64(&gbc); ctx->request_channel_layout = bytestream2_get_le64(&gbc);