freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Devel] Recursive composite glyphs


From: Owen Taylor
Subject: [Devel] Recursive composite glyphs
Date: Mon, 6 Jan 2003 14:48:19 -0500 (EST)
User-agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/21.2

A problem was reported to me where freetype, when given a
corrupt font that looks like it has a recursive composite
glyph, overflows it's stack and crashes. (After allocating
a huge amount of memory.)

The attached patch makes two changes in this area:

 - When loading composite glyphs, it puts a hard recursion
   limit of 5 on the loading, which should be enough for
   any real situation. (The TrueType spec doesn't make 
   clear whether composite glyphs can have composite
   glyphs as subglyphs at all.)

 - It makes the check for what is a composite glyph 
   stricter; only glyphs with a contours_count of -1,
   not any negative number, are considered composite glyphs.

   (-1 is what the TT spec requires, and this will reduce
   the chance of random garbage looking like a composite
   glyph.)

Regards,
                                        Owen

Attachment: freetype-composite-recurse.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]