freetype-commit
[Top][All Lists]
Advanced

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

[Git][freetype/freetype][master] 2 commits: * src/cff/cffdrivr/c (cff_ge


From: Werner Lemberg (@wl)
Subject: [Git][freetype/freetype][master] 2 commits: * src/cff/cffdrivr/c (cff_get_ps_name): Avoid unnecessary crash.
Date: Fri, 28 Apr 2023 13:37:23 +0000

Werner Lemberg pushed to branch master at FreeType / FreeType

Commits:

  • 966ff5a5
    by Werner Lemberg at 2023-04-28T15:25:20+02:00
    * src/cff/cffdrivr/c (cff_get_ps_name): Avoid unnecessary crash.
    
    The situation can happen if `FT_New_Face` (or one of its siblings) is called
    with a negative index to get the number of contained faces, followed
    immediately by a call to `FT_Get_Postscript_Name`.  While this is not a valid
    use of the FreeType library there is no need for a crash.
    
    Fixes #1219.
    
  • 08268691
    by Werner Lemberg at 2023-04-28T15:33:58+02:00
    * src/sfnt/ttload.c (tt_face_load_font_dir): Add another guard.
    
    Reject 'OTTO' fonts with no valid tables.
    

2 changed files:

Changes:

  • src/cff/cffdrivr.c
    ... ... @@ -634,7 +634,7 @@
    634 634
             return service->get_ps_font_name( FT_FACE( face ) );
    
    635 635
         }
    
    636 636
     
    
    637
    -    return (const char*)cff->font_name;
    
    637
    +    return cff ? (const char*)cff->font_name : NULL;
    
    638 638
       }
    
    639 639
     
    
    640 640
     
    

  • src/sfnt/ttload.c
    ... ... @@ -504,6 +504,13 @@
    504 504
     
    
    505 505
         FT_FRAME_EXIT();
    
    506 506
     
    
    507
    +    if ( !valid_entries )
    
    508
    +    {
    
    509
    +      FT_TRACE2(( "tt_face_load_font_dir: no valid tables found\n" ));
    
    510
    +      error = FT_THROW( Unknown_File_Format );
    
    511
    +      goto Exit;
    
    512
    +    }
    
    513
    +
    
    507 514
         FT_TRACE2(( "table directory loaded\n" ));
    
    508 515
         FT_TRACE2(( "\n" ));
    
    509 516
     
    


  • reply via email to

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