freetype-commit
[Top][All Lists]
Advanced

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

[Git][freetype/freetype][master] [bdf] Fix up user properties.


From: Alexei Podtelezhnikov (@apodtele)
Subject: [Git][freetype/freetype][master] [bdf] Fix up user properties.
Date: Sun, 17 Oct 2021 03:08:58 +0000

Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType

Commits:

1 changed file:

Changes:

  • src/bdf/bdflib.c
    ... ... @@ -852,7 +852,7 @@
    852 852
         p = font->user_props + font->nuser_props;
    
    853 853
     
    
    854 854
         n = ft_strlen( name ) + 1;
    
    855
    -    if ( n > FT_ULONG_MAX )
    
    855
    +    if ( n > FT_LONG_MAX )
    
    856 856
           return FT_THROW( Invalid_Argument );
    
    857 857
     
    
    858 858
         if ( FT_QALLOC( p->name, n ) )
    
    ... ... @@ -860,8 +860,9 @@
    860 860
     
    
    861 861
         FT_MEM_COPY( (char *)p->name, name, n );
    
    862 862
     
    
    863
    -    p->format  = format;
    
    864
    -    p->builtin = 0;
    
    863
    +    p->format     = format;
    
    864
    +    p->builtin    = 0;
    
    865
    +    p->value.atom = NULL;  /* nothing is ever stored here */
    
    865 866
     
    
    866 867
         n = _num_bdf_properties + font->nuser_props;
    
    867 868
     
    
    ... ... @@ -1181,7 +1182,7 @@
    1181 1182
         switch ( prop->format )
    
    1182 1183
         {
    
    1183 1184
         case BDF_ATOM:
    
    1184
    -      fp->value.atom = 0;
    
    1185
    +      fp->value.atom = NULL;
    
    1185 1186
           if ( value && value[0] )
    
    1186 1187
           {
    
    1187 1188
             if ( FT_STRDUP( fp->value.atom, value ) )
    
    ... ... @@ -2351,11 +2352,7 @@
    2351 2352
         /* Free up the user defined properties. */
    
    2352 2353
         for ( prop = font->user_props, i = 0;
    
    2353 2354
               i < font->nuser_props; i++, prop++ )
    
    2354
    -    {
    
    2355 2355
           FT_FREE( prop->name );
    
    2356
    -      if ( prop->format == BDF_ATOM )
    
    2357
    -        FT_FREE( prop->value.atom );
    
    2358
    -    }
    
    2359 2356
     
    
    2360 2357
         FT_FREE( font->user_props );
    
    2361 2358
     
    


  • reply via email to

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