4 extern "C" int LLVMFuzzerTestOneInput (const uint8_t *data, size_t size);
6 #if defined(__GNUC__) && (__GNUC__ >= 4) || (__clang__)
7 #define HB_UNUSED __attribute__((unused))
12 #ifdef HB_IS_IN_FUZZER
14 /* See src/failing-alloc.c */
15 extern "C" int alloc_state;
19 /* Just a dummy global variable */
20 static int HB_UNUSED alloc_state = 0;
25 _fuzzing_alloc_state (const uint8_t *data, size_t size)
27 /* https://github.com/harfbuzz/harfbuzz/pull/2764#issuecomment-1172589849 */
29 /* In 50% of the runs, don't fail the allocator. */
30 if (size && data[size - 1] < 0x80)