[fuzzing] Take whatever text we can
This commit is contained in:
parent
517a1bac97
commit
0bf76154f1
|
@ -25,9 +25,12 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
|||
hb_buffer_destroy (buffer);
|
||||
}
|
||||
|
||||
uint32_t text32[16];
|
||||
if (size > sizeof (text32)) {
|
||||
memcpy(text32, data + size - sizeof (text32), sizeof (text32));
|
||||
uint32_t text32[16] = {0};
|
||||
unsigned int len = sizeof (text32);
|
||||
if (size < len)
|
||||
len = size;
|
||||
memcpy(text32, data + size - len, len);
|
||||
|
||||
hb_buffer_t *buffer = hb_buffer_create ();
|
||||
hb_buffer_add_utf32 (buffer, text32, sizeof (text32) / sizeof (text32[0]), 0, -1);
|
||||
hb_buffer_guess_segment_properties (buffer);
|
||||
|
@ -36,7 +39,6 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
|||
|
||||
/* Misc calls on face. */
|
||||
test_face (face, text32[15]);
|
||||
}
|
||||
|
||||
hb_font_destroy (font);
|
||||
hb_face_destroy (face);
|
||||
|
|
Loading…
Reference in New Issue