Coverage Report

Created: 2024-07-27 06:31

/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
37.5k
{
7
37.5k
    if(size<3) return 0;
8
37.4k
    PIX *pixs;
9
37.4k
    SARRAY *saw1, *sad1;
10
11
37.4k
    leptSetStdNullHandler();
12
13
37.4k
    pixs = pixReadMemSpix(data, size);
14
37.4k
    if(pixs == NULL) return 0;
15
16
19.9k
    sad1 = pixProcessBarcodes(pixs, L_BF_ANY, L_USE_WIDTHS, &saw1, 1);
17
18
19.9k
    pixDestroy(&pixs);
19
19.9k
    sarrayDestroy(&saw1);
20
19.9k
    sarrayDestroy(&sad1);
21
19.9k
    return 0;
22
37.4k
}