[ft-colr] Fix color-stop iteration

pull/3938/head
Behdad Esfahbod 2 years ago
parent bbb89e62aa
commit c453c2fce9
  1. 11
      src/hb-ft-colr.hh

@ -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,

Loading…
Cancel
Save