File: main.cc

package info (click to toggle)
harfbuzz 6.0.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 109,068 kB
  • sloc: cpp: 91,977; ansic: 18,134; sh: 4,651; xml: 4,528; python: 4,087; makefile: 1,171
file content (22 lines) | stat: -rw-r--r-- 459 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include "hb-fuzzer.hh"

#include <cassert>
#include <cstdio>

int main (int argc, char **argv)
{
  for (int i = 1; i < argc; i++)
  {
    hb_blob_t *blob = hb_blob_create_from_file_or_fail (argv[i]);
    assert (blob);

    unsigned len = 0;
    const char *font_data = hb_blob_get_data (blob, &len);
    printf ("%s (%u bytes)\n", argv[i], len);

    LLVMFuzzerTestOneInput ((const uint8_t *) font_data, len);

    hb_blob_destroy (blob);
  }
  return 0;
}