summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'leptonica/prog/fuzzing/classapp_fuzzer.cc')
-rw-r--r--leptonica/prog/fuzzing/classapp_fuzzer.cc24
1 files changed, 24 insertions, 0 deletions
diff --git a/leptonica/prog/fuzzing/classapp_fuzzer.cc b/leptonica/prog/fuzzing/classapp_fuzzer.cc
new file mode 100644
index 00000000..61e8dc3e
--- /dev/null
+++ b/leptonica/prog/fuzzing/classapp_fuzzer.cc
@@ -0,0 +1,24 @@
+#include "leptfuzz.h"
+
+extern "C" int
+LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
+ if(size<3) return 0;
+
+ leptSetStdNullHandler();
+
+ PIX *pixs_payload = pixReadMemSpix(data, size);
+ if(pixs_payload == NULL) return 0;
+
+ BOX *box1 = boxCreate(150, 130, 1500, 355);
+ BOXA *boxa1;
+ BOXAA *boxaa1;
+ PIX *pix_copy = pixCopy(NULL, pixs_payload);
+ pixFindWordAndCharacterBoxes(pix_copy, box1, 120, &boxa1, &boxaa1, NULL);
+ boxDestroy(&box1);
+ boxaDestroy(&boxa1);
+ boxaaDestroy(&boxaa1);
+ pixDestroy(&pix_copy);
+
+ pixDestroy(&pixs_payload);
+ return 0;
+}