diff --git a/fuzzers/tint_all_transforms_fuzzer.cc b/fuzzers/tint_all_transforms_fuzzer.cc index e9af5abc59..7b76ab4e3f 100644 --- a/fuzzers/tint_all_transforms_fuzzer.cc +++ b/fuzzers/tint_all_transforms_fuzzer.cc @@ -18,9 +18,22 @@ namespace tint { namespace fuzzers { extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + struct Config { + uint32_t group; + uint32_t binding; + }; + if (size < sizeof(Config)) { + return 0; + } + auto* config = reinterpret_cast(data); + data += sizeof(Config); + size -= sizeof(Config); + tint::transform::Manager transform_manager; tint::transform::DataMap transform_inputs; - transform_inputs.Add(0, 0); + + transform_inputs.Add( + config->binding, config->group); transform_manager.Add(); transform_manager.Add(); transform_manager.Add(); diff --git a/fuzzers/tint_first_index_offset_fuzzer.cc b/fuzzers/tint_first_index_offset_fuzzer.cc index 69159810bb..d52106314b 100644 --- a/fuzzers/tint_first_index_offset_fuzzer.cc +++ b/fuzzers/tint_first_index_offset_fuzzer.cc @@ -18,9 +18,21 @@ namespace tint { namespace fuzzers { extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + struct Config { + uint32_t group; + uint32_t binding; + }; + if (size < sizeof(Config)) { + return 0; + } + auto* config = reinterpret_cast(data); + data += sizeof(Config); + size -= sizeof(Config); + tint::transform::Manager transform_manager; tint::transform::DataMap transform_inputs; - transform_inputs.Add(0, 0); + transform_inputs.Add( + config->binding, config->group); transform_manager.Add(); tint::fuzzers::CommonFuzzer fuzzer(InputFormat::kWGSL, OutputFormat::kSpv);