freetype-commit
[Top][All Lists]
Advanced

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

[Git][freetype/freetype][master] * src/sfnt/ttpost.c (load_format_*): St


From: Alexei Podtelezhnikov (@apodtele)
Subject: [Git][freetype/freetype][master] * src/sfnt/ttpost.c (load_format_*): Streamline frame reading.
Date: Mon, 03 Apr 2023 08:08:34 +0000

Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType

Commits:

  • 340767bf
    by Alexei Podtelezhnikov at 2023-04-02T22:00:59-04:00
    * src/sfnt/ttpost.c (load_format_*): Streamline frame reading.
    

1 changed file:

Changes:

  • src/sfnt/ttpost.c
    ... ... @@ -169,6 +169,7 @@
    169 169
     
    
    170 170
         FT_UShort*  glyph_indices = NULL;
    
    171 171
         FT_Byte**   name_strings  = NULL;
    
    172
    +    FT_Byte*    q;
    
    172 173
     
    
    173 174
     
    
    174 175
         if ( (FT_ULong)num_glyphs * 2 > post_len )
    
    ... ... @@ -182,9 +183,11 @@
    182 183
              FT_FRAME_ENTER( num_glyphs * 2 )           )
    
    183 184
           goto Fail;
    
    184 185
     
    
    186
    +    q = (FT_Byte*)stream->cursor;
    
    187
    +
    
    185 188
         for ( n = 0; n < num_glyphs; n++ )
    
    186 189
         {
    
    187
    -      FT_UShort  idx = FT_GET_USHORT();
    
    190
    +      FT_UShort  idx = FT_NEXT_USHORT( q );
    
    188 191
     
    
    189 192
     
    
    190 193
           if ( idx > num_names )
    
    ... ... @@ -272,6 +275,7 @@
    272 275
     
    
    273 276
         FT_UShort   n;
    
    274 277
         FT_UShort*  glyph_indices = NULL;
    
    278
    +    FT_Byte*    q;
    
    275 279
     
    
    276 280
     
    
    277 281
         /* check the number of glyphs, including the theoretical limit */
    
    ... ... @@ -287,9 +291,11 @@
    287 291
              FT_FRAME_ENTER( num_glyphs )               )
    
    288 292
           goto Fail;
    
    289 293
     
    
    294
    +    q = (FT_Byte*)stream->cursor;
    
    295
    +
    
    290 296
         for ( n = 0; n < num_glyphs; n++ )
    
    291 297
         {
    
    292
    -      FT_Int  idx = n + FT_GET_CHAR();
    
    298
    +      FT_Int  idx = n + FT_NEXT_CHAR( q );
    
    293 299
     
    
    294 300
     
    
    295 301
           if ( idx < 0 || idx > 257 )
    


  • reply via email to

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