diff options
author | Gabriel de Dietrich <gabriel.dedietrich@digia.com> | 2014-06-17 15:37:31 +0200 |
---|---|---|
committer | Jani Heikkinen <jani.heikkinen@digia.com> | 2014-06-18 13:39:37 +0200 |
commit | abcea1c5f06b2ea0428e08a3a71f08d39c29c2fd (patch) | |
tree | 0ddc99f0a1d08f7c068f78c62ba6cc37d340d191 | |
parent | 10ff9d5b6f9643d3bcae519d8bf5107711d4e55d (diff) |
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>
-rw-r--r-- | src/3rdparty/harfbuzz-ng/src/hb-coretext.cc | 3 |
1 files changed, 2 insertions, 1 deletions
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); |