[glyf] Rewrite a loop harmlessly

I hope...
This commit is contained in:
Behdad Esfahbod 2022-06-26 16:36:08 -06:00
parent cf57f04ddb
commit 8d242aaa8b
1 changed files with 4 additions and 1 deletions

View File

@ -171,7 +171,10 @@ struct glyf_accelerator_t
if (consumer.is_consuming_contour_points ())
{
for (unsigned point_index = 0; point_index + 4 < all_points.length; ++point_index)
unsigned count = all_points.length;
assert (count >= glyf_impl::PHANTOM_COUNT);
count -= glyf_impl::PHANTOM_COUNT;
for (unsigned point_index = 0; point_index < count; point_index++)
consumer.consume_point (all_points[point_index]);
consumer.points_end ();
}