[subset] Fix potential out of bounds write setting overlap flag on composite glyphs.

This commit is contained in:
Garret Rieger 2022-06-15 18:50:45 +00:00 committed by Behdad Esfahbod
parent 3f9226da37
commit 823f32a0e2
1 changed files with 5 additions and 2 deletions

View File

@ -714,8 +714,11 @@ struct glyf
void set_overlaps_flag () void set_overlaps_flag ()
{ {
const_cast<CompositeGlyphChain &> (StructAfter<CompositeGlyphChain, GlyphHeader> (header)) CompositeGlyphChain& glyph_chain = const_cast<CompositeGlyphChain &> (
.set_overlaps_flag (); StructAfter<CompositeGlyphChain, GlyphHeader> (header));
if (!bytes.check_range(&glyph_chain, CompositeGlyphChain::min_size))
return;
glyph_chain.set_overlaps_flag ();
} }
}; };