freetype-commit
[Top][All Lists]
Advanced

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

[Git][freetype/freetype][master] [sfnt] Restrict POST version 1.0.


From: Alexei Podtelezhnikov (@apodtele)
Subject: [Git][freetype/freetype][master] [sfnt] Restrict POST version 1.0.
Date: Fri, 05 Jan 2024 02:44:45 +0000

Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType

Commits:

  • 4a85ff0b
    by Alexei Podtelezhnikov (Алексей Подтележников) at 2024-01-04T21:38:51-05:00
    [sfnt] Restrict POST version 1.0.
    
    A font has surfaced with `post` version 1.0 and fewer than 258 glyphs.
    Its glyphs did not correspond to their names. We now reject such `post`
    strictly following specifications.
    
    * src/sfnt/ttpost.c (tt_face_get_ps_name): Check the number of glyphs
    for version 1.0.
    

1 changed file:

Changes:

  • src/sfnt/ttpost.c
    ... ... @@ -436,13 +436,8 @@
    436 436
     
    
    437 437
         format = face->postscript.FormatType;
    
    438 438
     
    
    439
    -    if ( format == 0x00010000L )
    
    440
    -    {
    
    441
    -      if ( idx < 258 )                    /* paranoid checking */
    
    442
    -        *PSname = MAC_NAME( idx );
    
    443
    -    }
    
    444
    -    else if ( format == 0x00020000L ||
    
    445
    -              format == 0x00025000L )
    
    439
    +    if ( format == 0x00020000L ||
    
    440
    +         format == 0x00025000L )
    
    446 441
         {
    
    447 442
           TT_Post_Names  names = &face->postscript_names;
    
    448 443
     
    
    ... ... @@ -466,6 +461,11 @@
    466 461
           }
    
    467 462
         }
    
    468 463
     
    
    464
    +    /* version 1.0 is only valid with 258 glyphs */
    
    465
    +    else if ( format == 0x00010000L              &&
    
    466
    +              face->max_profile.numGlyphs == 258 )
    
    467
    +      *PSname = MAC_NAME( idx );
    
    468
    +
    
    469 469
         /* nothing to do for format == 0x00030000L */
    
    470 470
     
    
    471 471
       End:
    


  • reply via email to

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