From patchwork Sat Oct 12 20:34:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 15727 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 C9D1B448EEE for ; Sat, 12 Oct 2019 23:36:02 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B3C02689BC3; Sat, 12 Oct 2019 23:36:02 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe03-2.mx.upcmail.net (vie01a-dmta-pe03-2.mx.upcmail.net [62.179.121.161]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B02B368839C for ; Sat, 12 Oct 2019 23:35:54 +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 1iJO7G-000278-41 for ffmpeg-devel@ffmpeg.org; Sat, 12 Oct 2019 22:35:54 +0200 Received: from localhost ([213.47.68.29]) by vie01a-pemc-psmtp-pe12.mail.upcmail.net with ESMTP id JO6HiL1dNwlysJO6HiuDpZ; Sat, 12 Oct 2019 22:34:53 +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=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=4L53U8rqUrJn-otDxoUA:9 a=pHzHmUro8NiASowvMSCR:22 a=Ew2E2A-JSTLzCXPT_086:22 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sat, 12 Oct 2019 22:34:01 +0200 Message-Id: <20191012203403.26941-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191012203403.26941-1-michael@niedermayer.cc> References: <20191012203403.26941-1-michael@niedermayer.cc> MIME-Version: 1.0 X-CMAE-Envelope: MS4wfPIYV1cCuJX0xV+EkYjtfsWpVNFyuG22PAosiK/6t0wqB3UNuUeE/FHnqy1cjeOKt2gGRDIFYLp+6rq5LjhgZMjEOsG6oruiVLNILwDcAowHqqGDm0eb 0KU7FkE0txfro7494hn0PpgB8+I2a0eG9IEUugNrBerjJXJtshYEOY+G Subject: [FFmpeg-devel] [PATCH 2/4] tools/target_dec_fuzzer: Also fuzz FF_COMPLIANCE_EXPERIMENTAL 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 improve coverage Signed-off-by: Michael Niedermayer --- tools/target_dec_fuzzer.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/target_dec_fuzzer.c b/tools/target_dec_fuzzer.c index 99e89ab092..8def3c9015 100644 --- a/tools/target_dec_fuzzer.c +++ b/tools/target_dec_fuzzer.c @@ -171,6 +171,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { if (size > 1024) { GetByteContext gbc; int extradata_size; + int flags; size -= 1024; bytestream2_init(&gbc, data + size, 1024); ctx->width = bytestream2_get_le32(&gbc); @@ -178,8 +179,11 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { ctx->bit_rate = bytestream2_get_le64(&gbc); ctx->bits_per_coded_sample = bytestream2_get_le32(&gbc); // Try to initialize a parser for this codec, note, this may fail which just means we test without one - if (bytestream2_get_byte(&gbc) & 1) + flags = bytestream2_get_byte(&gbc); + if (flags & 1) parser = av_parser_init(c->id); + if (flags & 2) + ctx->strict_std_compliance = FF_COMPLIANCE_EXPERIMENTAL; extradata_size = bytestream2_get_le32(&gbc);