mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-24 16:31:14 +01:00
[fuzz] make the custom loader to handle multiple files
Actually this was the way it used to work :)
This commit is contained in:
1 parent
1f5a54c768
commit
96b71e802f
1 file changed
+12
-15
+12
-15
@@ -1,28 +1,25 @@
|
||||
#include "hb-fuzzer.hh"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
|
||||
int main (int argc, char **argv)
|
||||
{
|
||||
hb_blob_t *blob = hb_blob_create_from_file (argv[1]);
|
||||
|
||||
unsigned int len;
|
||||
const char *font_data = hb_blob_get_data (blob, &len);
|
||||
if (len == 0)
|
||||
{
|
||||
printf ("Font not found.\n");
|
||||
exit (1);
|
||||
}
|
||||
|
||||
for (int i = 1; i < argc; i++)
|
||||
{
|
||||
hb_blob_t *blob = hb_blob_create_from_file (argv[i]);
|
||||
|
||||
unsigned int len;
|
||||
const char *font_data = hb_blob_get_data (blob, &len);
|
||||
if (len == 0)
|
||||
{
|
||||
printf ("Font not found.\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
printf ("%s\n", argv[i]);
|
||||
LLVMFuzzerTestOneInput ((const uint8_t *) font_data, len);
|
||||
|
||||
hb_blob_destroy (blob);
|
||||
}
|
||||
|
||||
hb_blob_destroy (blob);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in new issue
Block a user