Coverage Report

Created: 2024-07-27 06:27

/src/leptonica/prog/fuzzing/barcode_fuzzer.cc
Line
Count
Source
1
#include "leptfuzz.h"
2
#include "readbarcode.h"
3
4
extern "C" int
5
LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
6
2.19k
{
7
2.19k
    if(size<3) return 0;
8
2.19k
    PIX *pixs;
9
2.19k
    SARRAY *saw1, *sad1;
10
11
2.19k
    leptSetStdNullHandler();
12
13
2.19k
    pixs = pixReadMemSpix(data, size);
14
2.19k
    if(pixs == NULL) return 0;
15
16
1.59k
    sad1 = pixProcessBarcodes(pixs, L_BF_ANY, L_USE_WIDTHS, &saw1, 1);
17
18
1.59k
    pixDestroy(&pixs);
19
1.59k
    sarrayDestroy(&saw1);
20
1.59k
    sarrayDestroy(&sad1);
21
1.59k
    return 0;
22
2.19k
}