Debian Codegraph @

third_party/cgltf/fuzz/main.c

raw
1 /* How to fuzz:
2
3 clang main.c -O2 -g -fsanitize=address,fuzzer -o fuzz
4 cp -r data temp
5 ./fuzz temp/ -dict=gltf.dict -jobs=12 -workers=12
6
7 */
8 #define CGLTF_IMPLEMENTATION
9 #include "../cgltf.h"
10
11 int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size)
12 {
13 cgltf_options options = {cgltf_file_type_invalid};
14 cgltf_data* data = NULL;
15 cgltf_result res = cgltf_parse(&options, Data, Size, &data);
16 if (res == cgltf_result_success)
17 {
18 cgltf_validate(data);
19 cgltf_free(data);
20 }
21 return 0;
22 }