diff options
| author | Marc Jeanmougin <marc@jeanmougin.fr> | 2017-10-28 10:32:03 +0000 |
|---|---|---|
| committer | Marc Jeanmougin <marc@jeanmougin.fr> | 2017-10-28 10:32:03 +0000 |
| commit | 15fe5b74c46cbe12da26ef3c5543c5e0bd8d64c1 (patch) | |
| tree | 07481affb35715fac99c101a33a5a66c1212cbcb /testfiles/fuzzer.cpp | |
| parent | Preferences: cleanup (diff) | |
| download | inkscape-15fe5b74c46cbe12da26ef3c5543c5e0bd8d64c1.tar.gz inkscape-15fe5b74c46cbe12da26ef3c5543c5e0bd8d64c1.zip | |
Trying libFuzzer
Diffstat (limited to 'testfiles/fuzzer.cpp')
| -rw-r--r-- | testfiles/fuzzer.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/testfiles/fuzzer.cpp b/testfiles/fuzzer.cpp new file mode 100644 index 000000000..6dd09e753 --- /dev/null +++ b/testfiles/fuzzer.cpp @@ -0,0 +1,15 @@ +#include "xml/repr.h" +#include "inkscape.h" +#include "document.h" + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + g_type_init(); + Inkscape::GC::init(); + if ( !Inkscape::Application::exists() ) + Inkscape::Application::create("", false); + //void* a= sp_repr_read_mem((const char*)data, size, 0); + SPDocument *doc = SPDocument::createNewDocFromMem( (const char*)data, size, 0); + if(doc) + doc->doUnref(); + return 0; +} |
