From patchwork Fri Dec 6 14:56:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 16635 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 3864A44A5A7 for ; Fri, 6 Dec 2019 16:56:54 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1A9D268B5AA; Fri, 6 Dec 2019 16:56:54 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-vs1-f68.google.com (mail-vs1-f68.google.com [209.85.217.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1BEAA68B10C for ; Fri, 6 Dec 2019 16:56:48 +0200 (EET) Received: by mail-vs1-f68.google.com with SMTP id l24so5189445vsr.12 for ; Fri, 06 Dec 2019 06:56:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=RdO9iGVzW7gG6rxhJicLomwxGN1pyWfh7cPCn2Hb7EI=; b=dECE/OlC8Mrsa/mBs2v4KXZfWvNVt/mWGHCsIT2mnH5v+keBcejmRWUaGc6P3P2Z+5 depSj46+lS6Jch0k3TTZnpaskqc0zvkXafJ0GpZm66dQldzDm6cJ7tH6/DGyF4Ta+4uw F0k6k/tXLoZm37QBgTpsoD37uR10+fQ0CYpk07FSZ5MSDdpE/pUHB43r9uoHD6IXLLe2 DC0mIERjl6u9Zrw/+RzCsmJgkSo5V5Ja8bgENcWu/PHIhZqD4jXXSYbrBbf3orYonkBO RrleQDolhjoam78kTxZwMgvUDZ/MGwsmVzYVVJ/N+L4qpUL0x+DsOek6lno7NEkVZBOj hP2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=RdO9iGVzW7gG6rxhJicLomwxGN1pyWfh7cPCn2Hb7EI=; b=VDc6WVAn/47xxxfzdSlwGdPYakx7kuF2gYw+lt6UBzPUprbrMdhAAp5dzaEt5o1jtV hv0P0V8uK8Ey+HcJHwaym4pYfvq2QbY8p94iVYM8s4xQj1+Jdo20jddSpOV6obLj09wY 6WhfacJbe1HPQV4ExhD4VshkcisHNMHaUciQvXYghSLRRWz67Ws4GVjwtNq9hZkd3dQ1 K6IoR81dQVBzQG77rWITlhxi4Isiuc5qBgxMFdeMcxCnH1kNk9umECo5v4Sk9H9WQ6X2 S6ua9bOWFdNjnctkVlez5pFfB+Eq7pMpOVvygH1K1TPspu4DY/97ZBDZ2RnyrjZxTF3z MKFQ== X-Gm-Message-State: APjAAAU9mMCz7QhgISeeywN/3z8bJwc1qDOSMGCG+1L1QDbCrQRTdSUV eQ5kUZ3RNF12xdYEkn3IPi8qMAGRD00= X-Google-Smtp-Source: APXvYqxhtzXM8cO1GDUD+pkSGWM2bl3n0yzQKf2WY3AUzmYEuY1YpHeIPCib4ca1SZ2m47v4B/pMPg== X-Received: by 2002:a67:6345:: with SMTP id x66mr9425806vsb.132.1575644206239; Fri, 06 Dec 2019 06:56:46 -0800 (PST) Received: from localhost.localdomain ([181.23.68.111]) by smtp.gmail.com with ESMTPSA id o26sm5857217vsq.17.2019.12.06.06.56.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Dec 2019 06:56:45 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Fri, 6 Dec 2019 11:56:13 -0300 Message-Id: <20191206145613.874-1-jamrial@gmail.com> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] tools/target_dec_fuzzer: set request_channel_layout 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" Should increase coverage of some decoders. Signed-off-by: James Almer --- Passing 6 to av_get_default_channel_layout() will return the 5.1 layout but never 5.1(side), which is for example what the dts decoder actually looks for. Any suggestion on how to make the fuzzer pick one of the non default layouts using a given amount of channels? tools/target_dec_fuzzer.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/target_dec_fuzzer.c b/tools/target_dec_fuzzer.c index dcf47b0f4d..fbfbbbc7ac 100644 --- a/tools/target_dec_fuzzer.c +++ b/tools/target_dec_fuzzer.c @@ -47,6 +47,7 @@ #include "config.h" #include "libavutil/avassert.h" +#include "libavutil/channel_layout.h" #include "libavutil/imgutils.h" #include "libavutil/intreadwrite.h" @@ -207,6 +208,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { ctx->sample_rate = bytestream2_get_le32(&gbc); ctx->channels = (unsigned)bytestream2_get_le32(&gbc) % FF_SANE_NB_CHANNELS; + ctx->request_channel_layout = av_get_default_channel_layout((unsigned)bytestream2_get_le32(&gbc) % FF_SANE_NB_CHANNELS); ctx->block_align = bytestream2_get_le32(&gbc); ctx->codec_tag = bytestream2_get_le32(&gbc); keyframes = bytestream2_get_le64(&gbc);