/src/tinygltf/tests/fuzzer/fuzz_gltf.cc
Line | Count | Source |
1 | | #include <cstdint> |
2 | | #include <cstring> |
3 | | #include <memory> |
4 | | #include <vector> |
5 | | #include <iostream> |
6 | | |
7 | | #define STB_IMAGE_IMPLEMENTATION |
8 | | #define STB_IMAGE_WRITE_IMPLEMENTATION |
9 | | #define TINYGLTF_IMPLEMENTATION |
10 | | #include "tiny_gltf.h" |
11 | | |
12 | | static void parse_intCoding4(const uint8_t *data, size_t size) |
13 | 722 | { |
14 | | |
15 | 722 | tinygltf::Model model; |
16 | 722 | tinygltf::TinyGLTF ctx; |
17 | 722 | std::string err; |
18 | 722 | std::string warn; |
19 | | |
20 | 722 | const char *str = reinterpret_cast<const char *>(data); |
21 | | |
22 | 722 | bool ret = ctx.LoadASCIIFromString(&model, &err, &warn, str, size, /* base_dir */"" ); |
23 | 722 | (void)ret; |
24 | | |
25 | 722 | } |
26 | | |
27 | | extern "C" |
28 | | int LLVMFuzzerTestOneInput(std::uint8_t const* data, std::size_t size) |
29 | 722 | { |
30 | 722 | parse_intCoding4(data, size); |
31 | 722 | return 0; |
32 | 722 | } |
33 | | |