[ft-colr] Fix color-stop iteration

This commit is contained in:
Behdad Esfahbod 2022-12-23 11:33:23 -07:00
parent bbb89e62aa
commit c453c2fce9
1 changed files with 10 additions and 1 deletions

View File

@ -93,7 +93,16 @@ _hb_ft_color_line_get_color_stops (hb_color_line_t *color_line,
unsigned wrote = 0;
FT_ColorStopIterator iter = c->color_stop_iterator;
c->color_stop_iterator.current_color_stop = start;
if (start >= c->color_stop_iterator.num_color_stops)
{
*count = 0;
return c->color_stop_iterator.num_color_stops;
}
while (c->color_stop_iterator.current_color_stop < start)
FT_Get_Colorline_Stops(data->face,
&stop,
&c->color_stop_iterator);
while (count && *count &&
FT_Get_Colorline_Stops(data->face,