From abcea1c5f06b2ea0428e08a3a71f08d39c29c2fd Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Tue, 17 Jun 2014 15:37:31 +0200 Subject: 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 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/3rdparty/harfbuzz-ng/src/hb-coretext.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/3rdparty/harfbuzz-ng/src') diff --git a/src/3rdparty/harfbuzz-ng/src/hb-coretext.cc b/src/3rdparty/harfbuzz-ng/src/hb-coretext.cc index 4fef861acc..2507cd1d9f 100644 --- a/src/3rdparty/harfbuzz-ng/src/hb-coretext.cc +++ b/src/3rdparty/harfbuzz-ng/src/hb-coretext.cc @@ -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); -- cgit v1.2.3