#include <tesseract/baseapi.h>
#include "leptonica/allheaders.h"
#include <libgen.h>
#include <cstdio>
#include <cstdlib>
#include <string>
Go to the source code of this file.
◆ TESSERACT_FUZZER_HEIGHT
#define TESSERACT_FUZZER_HEIGHT 100 |
◆ TESSERACT_FUZZER_WIDTH
#define TESSERACT_FUZZER_WIDTH 100 |
◆ LLVMFuzzerInitialize()
int LLVMFuzzerInitialize |
( |
int * |
, |
|
|
char *** |
pArgv |
|
) |
| |
Definition at line 47 of file fuzzer-api.cpp.
48 if (std::getenv(
"TESSDATA_PREFIX") ==
nullptr) {
50 const std::string filepath = dirname(&binary_path[0]);
52 const std::string tessdata_path = filepath +
"/" +
"tessdata";
53 if (setenv(
"TESSDATA_PREFIX", tessdata_path.c_str(), 1) != 0) {
54 printf(
"Setenv failed\n");
60 if (api->
Init(
nullptr,
"eng") != 0) {
61 printf(
"Cannot initialize API\n");
◆ LLVMFuzzerTestOneInput()
int LLVMFuzzerTestOneInput |
( |
const uint8_t * |
data, |
|
|
size_t |
size |
|
) |
| |