freetype-devel
[Top][All Lists]
Advanced

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

[Devel] Num glyphs in cff fonts


From: Martin Muskens
Subject: [Devel] Num glyphs in cff fonts
Date: Fri, 18 Apr 2003 12:00:14 +0200

Hi,

In the file "cffobjs.c" in the routine "cff_face_init" this happens:

     root->num_glyphs = cff->num_glyphs;

after that, the root->num_glyphs get adapted, but the cff->num_glyphs are left unchanged:

       if ( dict->cid_registry )
          root->num_glyphs = dict->cid_count;
        else
          root->num_glyphs = cff->charstrings_index.count;


in the file "cffcmap.c" in the routine "cff_cmap_unicode_init" there is a line

    count = (FT_UInt)face->root.num_glyphs;

after that, this loop is done:

      for ( n = 0; n < count; n++ )
      {
        FT_UInt      sid   = charset->sids[n]; etc...


The problem is, that the sids array has been constructed with a cff->num_glyphs length, which is not always as large as "count". It results in a crash.

How to fix this problem?

best regards

Martin Muskens
Aurelon BV


reply via email to

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