freetype-commit
[Top][All Lists]
Advanced

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

[Git][freetype/freetype][master] [woff] Don't allocate table entries unt


From: Ben Wagner (@bungeman)
Subject: [Git][freetype/freetype][master] [woff] Don't allocate table entries until needed
Date: Tue, 14 Jun 2022 04:49:17 +0000

Ben Wagner pushed to branch master at FreeType / FreeType

Commits:

  • 58395dd2
    by Ben Wagner at 2022-06-13T15:32:28-04:00
    [woff] Don't allocate table entries until needed
    
    * src/sfnt/sfwoff.c (woff_open_font): delay allocating space for the
    table entries until they are actually written out with the data.
    

1 changed file:

Changes:

  • src/sfnt/sfwoff.c
    ... ... @@ -162,8 +162,7 @@
    162 162
         }
    
    163 163
     
    
    164 164
         /* Don't trust `totalSfntSize' before thorough checks. */
    
    165
    -    if ( FT_QALLOC( sfnt, 12 + woff.num_tables * 16UL ) ||
    
    166
    -         FT_NEW( sfnt_stream )                          )
    
    165
    +    if ( FT_QALLOC( sfnt, 12 ) || FT_NEW( sfnt_stream ) )
    
    167 166
           goto Exit;
    
    168 167
     
    
    169 168
         sfnt_header = sfnt;
    
    ... ... @@ -328,9 +327,7 @@
    328 327
         }
    
    329 328
     
    
    330 329
         /* Now use `totalSfntSize'. */
    
    331
    -    if ( FT_QREALLOC( sfnt,
    
    332
    -                      12 + woff.num_tables * 16UL,
    
    333
    -                      woff.totalSfntSize ) )
    
    330
    +    if ( FT_QREALLOC( sfnt, 12, woff.totalSfntSize ) )
    
    334 331
           goto Exit;
    
    335 332
     
    
    336 333
         sfnt_header = sfnt + 12;
    


  • reply via email to

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