barcode_fuzzer.cc 452 B

12345678910111213141516171819202122
  1. #include "leptfuzz.h"
  2. #include "readbarcode.h"
  3. extern "C" int
  4. LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
  5. {
  6. if(size<3) return 0;
  7. PIX *pixs;
  8. SARRAY *saw1, *sad1;
  9. leptSetStdNullHandler();
  10. pixs = pixReadMemSpix(data, size);
  11. if(pixs == NULL) return 0;
  12. sad1 = pixProcessBarcodes(pixs, L_BF_ANY, L_USE_WIDTHS, &saw1, 1);
  13. pixDestroy(&pixs);
  14. sarrayDestroy(&saw1);
  15. sarrayDestroy(&sad1);
  16. return 0;
  17. }