freetype-commit
[Top][All Lists]
Advanced

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

[Git][freetype/freetype][master] [pshinter] Revise the hint table handli


From: Alexei Podtelezhnikov (@apodtele)
Subject: [Git][freetype/freetype][master] [pshinter] Revise the hint table handling.
Date: Tue, 08 Feb 2022 14:37:37 +0000

Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType

Commits:

1 changed file:

Changes:

  • src/pshinter/pshrec.c
    ... ... @@ -63,16 +63,14 @@
    63 63
       {
    
    64 64
         FT_UInt   old_max = table->max_hints;
    
    65 65
         FT_UInt   new_max = count;
    
    66
    -    FT_Error  error   = FT_Err_Ok;
    
    66
    +    FT_Error  error;
    
    67 67
     
    
    68 68
     
    
    69
    -    if ( new_max > old_max )
    
    70
    -    {
    
    71
    -      /* try to grow the table */
    
    72
    -      new_max = FT_PAD_CEIL( new_max, 8 );
    
    73
    -      if ( !FT_RENEW_ARRAY( table->hints, old_max, new_max ) )
    
    74
    -        table->max_hints = new_max;
    
    75
    -    }
    
    69
    +    /* try to grow the table */
    
    70
    +    new_max = FT_PAD_CEIL( new_max, 8 );
    
    71
    +    if ( !FT_QRENEW_ARRAY( table->hints, old_max, new_max ) )
    
    72
    +      table->max_hints = new_max;
    
    73
    +
    
    76 74
         return error;
    
    77 75
       }
    
    78 76
     
    
    ... ... @@ -90,17 +88,14 @@
    90 88
         count = table->num_hints;
    
    91 89
         count++;
    
    92 90
     
    
    93
    -    if ( count >= table->max_hints )
    
    91
    +    if ( count > table->max_hints )
    
    94 92
         {
    
    95 93
           error = ps_hint_table_ensure( table, count, memory );
    
    96 94
           if ( error )
    
    97 95
             goto Exit;
    
    98 96
         }
    
    99 97
     
    
    100
    -    hint        = table->hints + count - 1;
    
    101
    -    hint->pos   = 0;
    
    102
    -    hint->len   = 0;
    
    103
    -    hint->flags = 0;
    
    98
    +    hint = table->hints + count - 1;  /* initialized upstream */
    
    104 99
     
    
    105 100
         table->num_hints = count;
    
    106 101
     
    


  • reply via email to

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