Home | History | Annotate | Download | only in fuzzing
      1 #include "hb-fuzzer.hh"
      2 
      3 #include <stdio.h>
      4 #include <stdlib.h>
      5 #include <assert.h>
      6 
      7 int main(int argc, char **argv) {
      8   hb_blob_t *blob = hb_blob_create_from_file (argv[1]);
      9   unsigned int len;
     10   const char *font_data = hb_blob_get_data (blob, &len);
     11   if (len == 0)
     12   {
     13     printf ("Font not found.\n");
     14     exit (1);
     15   }
     16 
     17   for (int i = 1; i < argc; i++) {
     18     printf ("%s\n", argv[i]);
     19     LLVMFuzzerTestOneInput((const uint8_t *) font_data, len);
     20   }
     21 
     22   hb_blob_destroy (blob);
     23 }
     24