mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-29 09:34:05 +01:00
[glyf] Add a pre-allocation for phantom points
This commit is contained in:
1 parent
8d242aaa8b
commit
fc72a1d22d
1 file changed
+2
-1
@@ -158,7 +158,8 @@ struct SimpleGlyph
|
||||
if (unlikely (!bytes.check_range (&endPtsOfContours[num_contours - 1]))) return false;
|
||||
unsigned int num_points = endPtsOfContours[num_contours - 1] + 1;
|
||||
|
||||
points_.resize (num_points);
|
||||
points_.alloc (num_points + 4); // Allocate for phantom points, to avoid a possible copy
|
||||
if (!points_.resize (num_points)) return false;
|
||||
if (phantom_only) return true;
|
||||
|
||||
for (int i = 0; i < num_contours; i++)
|
||||
|
||||
Reference in new issue
Block a user