freetype-commit
[Top][All Lists]
Advanced

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

[Git][freetype/freetype][master] [base, type1] Better handling of out-of


From: Werner Lemberg (@wl)
Subject: [Git][freetype/freetype][master] [base, type1] Better handling of out-of-memory situations.
Date: Sun, 21 Aug 2022 17:44:12 +0000

Werner Lemberg pushed to branch master at FreeType / FreeType

Commits:

  • 37b718d5
    by Chris Liddell at 2022-08-21T19:41:45+02:00
    [base, type1] Better handling of out-of-memory situations.
    
    This follows similar code in `cff_slot_done`.
    
    * src/base/ftobjs.c (ft_glyphslot_done), src/type1/t1objs.c
    (T1_GlyphSlot_Done): Check `internal` pointer.
    
    The Type1 problems was reported as
    
      https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=50057.
    

2 changed files:

Changes:

  • src/base/ftobjs.c
    ... ... @@ -631,8 +631,9 @@
    631 631
     #ifdef FT_CONFIG_OPTION_SVG
    
    632 632
         if ( slot->face->face_flags & FT_FACE_FLAG_SVG )
    
    633 633
         {
    
    634
    -      /* free memory in case SVG was there */
    
    635
    -      if ( slot->internal->flags & FT_GLYPH_OWN_GZIP_SVG )
    
    634
    +      /* Free memory in case SVG was there.                          */
    
    635
    +      /* `slot->internal` might be NULL in out-of-memory situations. */
    
    636
    +      if ( slot->internal && slot->internal->flags & FT_GLYPH_OWN_GZIP_SVG )
    
    636 637
           {
    
    637 638
             FT_SVG_Document  doc = (FT_SVG_Document)slot->other;
    
    638 639
     
    

  • src/type1/t1objs.c
    ... ... @@ -146,7 +146,9 @@
    146 146
       FT_LOCAL_DEF( void )
    
    147 147
       T1_GlyphSlot_Done( FT_GlyphSlot  slot )
    
    148 148
       {
    
    149
    -    slot->internal->glyph_hints = NULL;
    
    149
    +    /* `slot->internal` might be NULL in out-of-memory situations. */
    
    150
    +    if ( slot->internal )
    
    151
    +      slot->internal->glyph_hints = NULL;
    
    150 152
       }
    
    151 153
     
    
    152 154
     
    


  • reply via email to

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