提交 3216e44f 编写于 作者: B Behdad Esfahbod

[uniscribe] Fix scratch-buffer accounting

上级 beeb12c9
...@@ -776,13 +776,14 @@ retry: ...@@ -776,13 +776,14 @@ retry:
} }
} }
/* All the following types are sized in multiples of sizeof(int). */ /* The -2 in the following is to compensate for possible
unsigned int glyphs_size = scratch_size / ((sizeof (WORD) + * alignment needed after the WORD array. sizeof(WORD) == 2. */
sizeof (SCRIPT_GLYPHPROP) + unsigned int glyphs_size = (scratch_size * sizeof (int) - 2)
sizeof (int) + / (sizeof (WORD) +
sizeof (GOFFSET) + sizeof (SCRIPT_GLYPHPROP) +
sizeof (uint32_t)) sizeof (int) +
/ sizeof (int)); sizeof (GOFFSET) +
sizeof (uint32_t));
ALLOCATE_ARRAY (WORD, glyphs, glyphs_size); ALLOCATE_ARRAY (WORD, glyphs, glyphs_size);
ALLOCATE_ARRAY (SCRIPT_GLYPHPROP, glyph_props, glyphs_size); ALLOCATE_ARRAY (SCRIPT_GLYPHPROP, glyph_props, glyphs_size);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册