freetype-commit
[Top][All Lists]
Advanced

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

[Git][freetype/freetype][master] * src/raster/ftraster.c (Convert_Glyph)


From: Alexei Podtelezhnikov (@apodtele)
Subject: [Git][freetype/freetype][master] * src/raster/ftraster.c (Convert_Glyph): Fix null-dereference.
Date: Fri, 13 Oct 2023 13:44:42 +0000

Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType

Commits:

  • f09c5e58
    by Alexei Podtelezhnikov (Алексей Подтележников) at 2023-10-13T13:44:39+00:00
    * src/raster/ftraster.c (Convert_Glyph): Fix null-dereference.

1 changed file:

Changes:

  • src/raster/ftraster.c
    ... ... @@ -1996,16 +1996,18 @@
    1996 1996
           if ( Decompose_Curve( RAS_VARS first, last, flipped ) )
    
    1997 1997
             return FAILURE;
    
    1998 1998
     
    
    1999
    +      /* Note that ras.gProfile can stay nil if the contour was */
    
    2000
    +      /* too small to be drawn or degenerate.                   */
    
    2001
    +      if ( !ras.gProfile )
    
    2002
    +        continue;
    
    2003
    +
    
    1999 2004
           /* we must now check whether the extreme arcs join or not */
    
    2000 2005
           if ( FRAC( ras.lastY ) == 0 &&
    
    2001 2006
                ras.lastY >= ras.minY  &&
    
    2002 2007
                ras.lastY <= ras.maxY  )
    
    2003
    -        if ( ras.gProfile                        &&
    
    2004
    -             ( ras.gProfile->flags & Flow_Up ) ==
    
    2008
    +        if ( ( ras.gProfile->flags & Flow_Up ) ==
    
    2005 2009
                    ( ras.cProfile->flags & Flow_Up ) )
    
    2006 2010
               ras.top--;
    
    2007
    -        /* Note that ras.gProfile can be nil if the contour was too small */
    
    2008
    -        /* to be drawn.                                                   */
    
    2009 2011
     
    
    2010 2012
           lastProfile = ras.cProfile;
    
    2011 2013
           if ( ras.top != ras.cProfile->offset &&
    
    ... ... @@ -2017,8 +2019,7 @@
    2017 2019
             return FAILURE;
    
    2018 2020
     
    
    2019 2021
           /* close the `next profile in contour' linked list */
    
    2020
    -      if ( ras.gProfile )
    
    2021
    -        lastProfile->next = ras.gProfile;
    
    2022
    +      lastProfile->next = ras.gProfile;
    
    2022 2023
         }
    
    2023 2024
     
    
    2024 2025
         if ( Finalize_Profile_Table( RAS_VAR ) )
    


  • reply via email to

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