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