freetype-commit
[Top][All Lists]
Advanced

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

[Git][freetype/freetype][master] [sfnt] Avoid invalid face index.


From: Werner Lemberg (@wl)
Subject: [Git][freetype/freetype][master] [sfnt] Avoid invalid face index.
Date: Thu, 17 Mar 2022 18:27:17 +0000

Werner Lemberg pushed to branch master at FreeType / FreeType

Commits:

2 changed files:

Changes:

  • src/sfnt/sfobjs.c
    ... ... @@ -566,7 +566,7 @@
    566 566
         face_index = FT_ABS( face_instance_index ) & 0xFFFF;
    
    567 567
     
    
    568 568
         /* value -(N+1) requests information on index N */
    
    569
    -    if ( face_instance_index < 0 )
    
    569
    +    if ( face_instance_index < 0 && face_index > 0 )
    
    570 570
           face_index--;
    
    571 571
     
    
    572 572
         if ( face_index >= face->ttc_header.count )
    

  • src/sfnt/sfwoff2.c
    ... ... @@ -2085,7 +2085,7 @@
    2085 2085
         /* Validate requested face index. */
    
    2086 2086
         *num_faces = woff2.num_fonts;
    
    2087 2087
         /* value -(N+1) requests information on index N */
    
    2088
    -    if ( *face_instance_index < 0 )
    
    2088
    +    if ( *face_instance_index < 0 && face_index > 0 )
    
    2089 2089
           face_index--;
    
    2090 2090
     
    
    2091 2091
         if ( face_index >= woff2.num_fonts )
    


  • reply via email to

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