src/truetype/ttgload.c: says
        /* Maximum recursion depth we allow for composite glyphs.
         * The TrueType spec doesn't say anything about recursion,
         * so it isn't clear that recursion is allowed at all. But
         * we'll be generous.
         */
        #define TT_MAX_COMPOSITE_RECURSE 5
This value is used to specify the maximum depth allowed to which
composite glyphs may be nested.

But the truetype spec does talk about this, it's a field in maxp
maxComponentDepth. So I suggest the following patch:

(True, there aren't many fonts with composites nested 5 deep, but
someone gave me one)
*** ttgload.c~	2005-08-28 20:58:37.000000000 -0700
--- ttgload.c	2005-08-28 20:58:37.000000000 -0700
***************
*** 63,76 ****
  #define UNSCALED_COMPONENT_OFFSET  0x1000
  
  
- /* Maximum recursion depth we allow for composite glyphs.
-  * The TrueType spec doesn't say anything about recursion,
-  * so it isn't clear that recursion is allowed at all. But
-  * we'll be generous.
-  */
- #define TT_MAX_COMPOSITE_RECURSE 5
- 
- 
  
    /*************************************************************************/
    /*                                                                       */
--- 63,68 ----
***************
*** 984,990 ****
  #endif
  
  
!     if ( recurse_count >= TT_MAX_COMPOSITE_RECURSE )
      {
        error = TT_Err_Invalid_Composite;
        goto Exit;
--- 976,982 ----
  #endif
  
  
!     if ( recurse_count > face->max_profile.maxComponentDepth )
      {
        error = TT_Err_Invalid_Composite;
        goto Exit;
_______________________________________________
Freetype-devel mailing list
Freetype-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/freetype-devel

Reply via email to