[uniscribe] Fix scratch-buffer accounting
This commit is contained in:
parent
beeb12c9af
commit
3216e44feb
|
@ -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. */
|
||||||
|
unsigned int glyphs_size = (scratch_size * sizeof (int) - 2)
|
||||||
|
/ (sizeof (WORD) +
|
||||||
sizeof (SCRIPT_GLYPHPROP) +
|
sizeof (SCRIPT_GLYPHPROP) +
|
||||||
sizeof (int) +
|
sizeof (int) +
|
||||||
sizeof (GOFFSET) +
|
sizeof (GOFFSET) +
|
||||||
sizeof (uint32_t))
|
sizeof (uint32_t));
|
||||||
/ sizeof (int));
|
|
||||||
|
|
||||||
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);
|
||||||
|
|
Loading…
Reference in New Issue