MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / LLVMFuzzerTestOneInput

Function LLVMFuzzerTestOneInput

apps/fuzzers/Fuzzer/fuzz_rtm.cpp:23–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21// is unchecked there is unchecked here too.
22
23extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
24{
25 // Force the 8-byte "RTM_0100" magic so mutations reach the step/bone-count header
26 // and the count-driven bone-name + keyframe blocks instead of failing the strcmp.
27 static const uint8_t HDR[] = {'R', 'T', 'M', '_', '0', '1', '0', '0'};
28 std::vector<uint8_t> buf = fuzz::ForceHeader(HDR, sizeof(HDR), data, size);
29 Poseidon::Asset::Formats::RTMAnimation anim;
30 Poseidon::Asset::Formats::readRTMFromMemory(buf.data(), buf.size(), anim);
31 return 0;
32}

Callers

nothing calls this directly

Calls 3

ForceHeaderFunction · 0.85
readRTMFromMemoryFunction · 0.85
sizeMethod · 0.80

Tested by

no test coverage detected