googlefonts / sfntly

A Library for Using, Editing, and Creating SFNT-based Fonts
451 stars 162 forks source link

Check read value in CompositeGlyph::Initialize() #80

Closed leizleiz closed 7 years ago

leizleiz commented 7 years ago

During initialization, the loop that does the reads can go out of bounds. The return value is -1 but there is no check for that. Thus the loop keeps going for much longer than it has to.

While we are here, also sanitize the usage of the contourindex variable as some of that looks suspicious.