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>
|
|
|
|
|
2019-05-11 19:50:42 +00:00
|
|
|
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]);
|
2019-05-11 22:48:41 +00:00
|
|
|
|
2018-10-01 20:46:08 +00:00
|
|
|
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
|
|
|
|
2019-05-11 22:48:41 +00:00
|
|
|
for (int i = 1; i < argc; i++)
|
2019-05-11 19:50:42 +00:00
|
|
|
{
|
2018-10-01 20:46:08 +00:00
|
|
|
printf ("%s\n", argv[i]);
|
2019-05-11 19:50:42 +00:00
|
|
|
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);
|
2019-05-11 19:50:42 +00:00
|
|
|
|
|
|
|
return 0;
|
2016-12-21 02:50:38 +00:00
|
|
|
}
|