2016-12-21 02:50:38 +00:00
|
|
|
#include "hb-fuzzer.hh"
|
|
|
|
|
2018-10-01 20:46:08 +00:00
|
|
|
#include <stdio.h>
|
2018-10-03 17:56:58 +00:00
|
|
|
#include <stdlib.h>
|
2016-12-21 02:50:38 +00:00
|
|
|
#include <assert.h>
|
|
|
|
|
|
|
|
int main(int argc, char **argv) {
|
2018-10-01 20:46:08 +00:00
|
|
|
hb_blob_t *blob = hb_blob_create_from_file (argv[1]);
|
|
|
|
unsigned int len;
|
|
|
|
const char *font_data = hb_blob_get_data (blob, &len);
|
2018-10-03 17:56:58 +00:00
|
|
|
if (len == 0)
|
|
|
|
{
|
2018-10-11 19:42:54 +00:00
|
|
|
printf ("Font not found.\n");
|
2018-10-03 17:56:58 +00:00
|
|
|
exit (1);
|
|
|
|
}
|
2018-10-01 20:46:08 +00:00
|
|
|
|
2016-12-21 02:50:38 +00:00
|
|
|
for (int i = 1; i < argc; i++) {
|
2018-10-01 20:46:08 +00:00
|
|
|
printf ("%s\n", argv[i]);
|
|
|
|
LLVMFuzzerTestOneInput((const uint8_t *) font_data, len);
|
2016-12-21 02:50:38 +00:00
|
|
|
}
|
2018-10-01 20:46:08 +00:00
|
|
|
|
|
|
|
hb_blob_destroy (blob);
|
2016-12-21 02:50:38 +00:00
|
|
|
}
|