The Birdfont Source Code


All Repositories / birdfont.git / blobdiff – RSS feed

Merge ../birdfont-2.x

Changes made to libbirdfont/OpenFontFormat/GlyfTable.vala

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
--- libbirdfont/OpenFontFormat/GlyfTable.vala +++ libbirdfont/OpenFontFormat/GlyfTable.vala @@ -209,7 +209,7 @@ uint16 end_point; uint16 npoints; int16 ncontours; - int16 nflags; + uint16 nflags; int glyph_offset; uint len; uint coordinate_length; @@ -223,6 +223,12 @@ g.remove_empty_paths (); glyf_data = g.get_ttf_data (); + + int points = glyf_data.get_num_points (); + if (unlikely (points >= uint16.MAX)) { + warning (@"Too many points in glyph $(g.get_name ()) ($points)"); + throw new FileError.FAILED (t_("Too many control points") + " " + t_("in") + @" $(g.get_name ())"); + } this.glyf_data.add (glyf_data);