mirror of
https://github.com/harfbuzz/harfbuzz.git
synced 2025-04-13 08:42:59 +00:00
[ft-colr] Fix crash if palette index is out-of-range
This commit is contained in:
parent
ad9fa13d23
commit
8685653cc7
1 changed files with 3 additions and 1 deletions
|
@ -167,7 +167,7 @@ _hb_ft_color_line_get_color_stops (hb_color_line_t *color_line,
|
|||
hb_color_get_red (color),
|
||||
(hb_color_get_alpha (color) * stop.color.alpha) >> 14);
|
||||
}
|
||||
else
|
||||
else if (c->palette)
|
||||
{
|
||||
FT_Color ft_color = c->palette[stop.color.palette_index];
|
||||
color_stops->color = HB_COLOR (ft_color.blue,
|
||||
|
@ -175,6 +175,8 @@ _hb_ft_color_line_get_color_stops (hb_color_line_t *color_line,
|
|||
ft_color.red,
|
||||
(ft_color.alpha * stop.color.alpha) >> 14);
|
||||
}
|
||||
else
|
||||
color_stops->color = HB_COLOR (0, 0, 0, 0);
|
||||
}
|
||||
|
||||
color_stops++;
|
||||
|
|
Loading…
Add table
Reference in a new issue