| 87 | } |
| 88 | |
| 89 | extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { |
| 90 | if (size <= 3) return 0; |
| 91 | |
| 92 | // Switch types depending on the first byte of the input. |
| 93 | const auto type1 = data[0] & 0x0F; |
| 94 | const auto type2 = (data[0] & 0xF0) >> 4; |
| 95 | data++; |
| 96 | size--; |
| 97 | try { |
| 98 | invoke(type1, [=](auto param1) { |
| 99 | invoke(type2, [=](auto param2) { |
| 100 | invoke_fmt<decltype(param1), decltype(param2)>(data, size); |
| 101 | }); |
| 102 | }); |
| 103 | } catch (std::exception&) { |
| 104 | } |
| 105 | return 0; |
| 106 | } |