Getting to the way it's supposed to be!
This commit is contained in:
39
modules/ufbx/misc/fuzz_ufbx.c
Normal file
39
modules/ufbx/misc/fuzz_ufbx.c
Normal file
@@ -0,0 +1,39 @@
|
||||
#define _CRT_SECURE_NO_WARNINGS
|
||||
|
||||
#if defined(_WIN32)
|
||||
#define ufbx_assert(cond) do { \
|
||||
if (!(cond)) __debugbreak(); \
|
||||
} while (0)
|
||||
#else
|
||||
#define ufbx_assert(cond) do { \
|
||||
if (!(cond)) __builtin_trap(); \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
#include "../ufbx.c"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
if (argc < 2) {
|
||||
fprintf(stderr, "Usage: fuzz_ufbx <file>\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
ufbx_load_opts opts = { 0 };
|
||||
|
||||
for (int i = 2; i < argc; i++) {
|
||||
if (!strcmp(argv[i], "-d")) {
|
||||
opts.temp_huge_size = 1;
|
||||
opts.result_huge_size = 1;
|
||||
}
|
||||
}
|
||||
|
||||
ufbx_scene *scene = ufbx_load_file(argv[1], &opts, NULL);
|
||||
ufbx_free_scene(scene);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user