mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-24 16:31:14 +01:00
Force blob generation and memory check in hb-subset-fuzzer
This commit is contained in:
1 parent
2e7021da7d
commit
c85f624b51
1 file changed
+14
@@ -3,6 +3,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "hb-subset.h"
|
||||
|
||||
@@ -32,6 +33,19 @@ trySubset (hb_face_t *face,
|
||||
}
|
||||
|
||||
hb_face_t *result = hb_subset (face, input);
|
||||
{
|
||||
hb_blob_t *blob = hb_face_reference_blob (result);
|
||||
unsigned int length;
|
||||
const char *data = hb_blob_get_data (blob, &length);
|
||||
|
||||
// Something not optimizable just to access all the blob data
|
||||
unsigned int bytes_count = 0;
|
||||
for (unsigned int i = 0; i < length; ++i)
|
||||
if (data[i]) ++bytes_count;
|
||||
assert (bytes_count);
|
||||
|
||||
hb_blob_destroy (blob);
|
||||
}
|
||||
hb_face_destroy (result);
|
||||
|
||||
hb_subset_input_destroy (input);
|
||||
|
||||
Reference in new issue
Block a user