|
|
|
@ -342,15 +342,20 @@ struct MarkBasePosBuffers |
|
|
|
|
{ |
|
|
|
|
unsigned base_anchors[class_count * base_count]; |
|
|
|
|
unsigned mark_anchors[mark_count]; |
|
|
|
|
uint64_t anchors_buffer[class_count * base_count]; |
|
|
|
|
uint8_t anchor_buffers[class_count * base_count + 100]; |
|
|
|
|
uint8_t class_buffer[class_count * 2]; |
|
|
|
|
|
|
|
|
|
MarkBasePosBuffers(hb_serialize_context_t* c) |
|
|
|
|
{ |
|
|
|
|
for (unsigned i = 0; i < sizeof(anchor_buffers) / 2; i++) |
|
|
|
|
{ |
|
|
|
|
uint16_t* value = (uint16_t*) (&anchor_buffers[2*i]); |
|
|
|
|
*value = i; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for (unsigned i = 0; i < class_count * base_count; i++) |
|
|
|
|
{ |
|
|
|
|
anchors_buffer[i] = i; |
|
|
|
|
base_anchors[i] = add_object ((char*) &anchors_buffer[i], 8, c); |
|
|
|
|
base_anchors[i] = add_object ((char*) &anchor_buffers[i], 100, c); |
|
|
|
|
if (i < class_count) { |
|
|
|
|
class_buffer[i*2] = (uint8_t) ((i >> 8) & 0xFF); |
|
|
|
|
class_buffer[i*2 + 1] = (uint8_t) (i & 0xFF); |
|
|
|
@ -359,7 +364,7 @@ struct MarkBasePosBuffers |
|
|
|
|
|
|
|
|
|
for (unsigned i = 0; i < mark_count; i++) |
|
|
|
|
{ |
|
|
|
|
mark_anchors[i] = add_object ((char*) &anchors_buffer[i], 4, c); |
|
|
|
|
mark_anchors[i] = add_object ((char*) &anchor_buffers[i], 4, c); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1952,12 +1957,12 @@ static void test_resolve_with_basic_mark_base_pos_1_split () |
|
|
|
|
void* buffer = malloc (buffer_size); |
|
|
|
|
assert (buffer); |
|
|
|
|
hb_serialize_context_t c (buffer, buffer_size); |
|
|
|
|
populate_serializer_with_large_mark_base_pos_1 <40, 10, 1100, 1>(&c); |
|
|
|
|
populate_serializer_with_large_mark_base_pos_1 <40, 10, 110, 1>(&c); |
|
|
|
|
|
|
|
|
|
void* expected_buffer = malloc (buffer_size); |
|
|
|
|
assert (expected_buffer); |
|
|
|
|
hb_serialize_context_t e (expected_buffer, buffer_size); |
|
|
|
|
populate_serializer_with_large_mark_base_pos_1 <40, 10, 1100, 2>(&e); |
|
|
|
|
populate_serializer_with_large_mark_base_pos_1 <40, 10, 110, 2>(&e); |
|
|
|
|
|
|
|
|
|
run_resolve_overflow_test ("test_resolve_with_basic_mark_base_pos_1_split", |
|
|
|
|
c, |
|
|
|
|