[colr] Don't access baseGlyphList unless v1
This was showing up sporadic crashes due to invalid reads.
This commit is contained in:
parent
47dbebff39
commit
5bd3c07b54
|
@ -1976,22 +1976,24 @@ struct COLR
|
||||||
paint_glyph (hb_font_t *font, hb_codepoint_t glyph, hb_paint_funcs_t *funcs, void *data, unsigned int palette, hb_color_t foreground) const
|
paint_glyph (hb_font_t *font, hb_codepoint_t glyph, hb_paint_funcs_t *funcs, void *data, unsigned int palette, hb_color_t foreground) const
|
||||||
{
|
{
|
||||||
VarStoreInstancer instancer (this+varStore,
|
VarStoreInstancer instancer (this+varStore,
|
||||||
this+varIdxMap,
|
this+varIdxMap,
|
||||||
hb_array (font->coords, font->num_coords));
|
hb_array (font->coords, font->num_coords));
|
||||||
|
|
||||||
hb_paint_context_t c (this, funcs, data, font, palette, foreground, instancer);
|
hb_paint_context_t c (this, funcs, data, font, palette, foreground, instancer);
|
||||||
|
|
||||||
const Paint *paint = get_base_glyph_paint (glyph);
|
if (version == 1)
|
||||||
if (paint)
|
|
||||||
{
|
{
|
||||||
// COLRv1 glyph
|
const Paint *paint = get_base_glyph_paint (glyph);
|
||||||
c.funcs->push_root_transform (c.data, font);
|
if (paint)
|
||||||
|
{
|
||||||
|
// COLRv1 glyph
|
||||||
|
c.funcs->push_root_transform (c.data, font);
|
||||||
|
|
||||||
c.recurse (*paint);
|
c.recurse (*paint);
|
||||||
|
|
||||||
c.funcs->pop_root_transform (c.data);
|
c.funcs->pop_root_transform (c.data);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const BaseGlyphRecord *record = get_base_glyph_record (glyph);
|
const BaseGlyphRecord *record = get_base_glyph_record (glyph);
|
||||||
|
|
Loading…
Reference in New Issue