harfbuzz-ng: Pre-allocate enough space for CoreText buffer
This fixes an assert in OS X 10.10 Yosemite, where the pre- allocated buffer would be too small to hold 3 successive calls to ALLOCATE_ARRAY. Task-number: QTBUG-39504 Change-Id: I5a0ae36170636eb97ab21c5903b96674e2a99547 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>bb10
parent
10ff9d5b6f
commit
abcea1c5f0
|
|
@ -738,7 +738,8 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan,
|
|||
if (num_glyphs == 0)
|
||||
continue;
|
||||
|
||||
buffer->ensure (buffer->len + num_glyphs + (endWithPDF ? 1 : 0));
|
||||
const long ensureCount = DIV_CEIL(sizeof(CGGlyph) + sizeof(CGPoint) + sizeof(CFIndex), sizeof(*scratch));
|
||||
buffer->ensure (buffer->len + ensureCount * (num_glyphs + (endWithPDF ? 1 : 0)));
|
||||
|
||||
scratch = buffer->get_scratch_buffer (&scratch_size);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue