freetype-commit
[Top][All Lists]
Advanced

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

[freetype2] master 5e9caaee7: [pshinter] Ensure all point flags are init


From: Werner Lemberg
Subject: [freetype2] master 5e9caaee7: [pshinter] Ensure all point flags are initialized.
Date: Mon, 24 Jan 2022 13:23:25 -0500 (EST)

branch: master
commit 5e9caaee7885cbc82f9f821bbec7f6c86f25b33a
Author: Ben Wagner <bungeman@chromium.org>
Commit: Ben Wagner <bungeman@chromium.org>

    [pshinter] Ensure all point flags are initialized.
    
    Only off curve point flags were fully initialized.
    
    * src/pshinter/pshalgo.c (psh_glyph_init): always initialize flags.
    
    Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43930
---
 src/pshinter/pshalgo.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/pshinter/pshalgo.c b/src/pshinter/pshalgo.c
index 494eabe80..a237f6c41 100644
--- a/src/pshinter/pshalgo.c
+++ b/src/pshinter/pshalgo.c
@@ -1228,8 +1228,9 @@
         FT_Pos  dxi, dyi, dxo, dyo;
 
 
+        point->flags = 0;
         if ( !( outline->tags[n] & FT_CURVE_TAG_ON ) )
-          point->flags = PSH_POINT_OFF;
+          psh_point_set_off( point );
 
         dxi = vec[n].x - vec[n_prev].x;
         dyi = vec[n].y - vec[n_prev].y;
@@ -1242,14 +1243,14 @@
         point->dir_out = psh_compute_dir( dxo, dyo );
 
         /* detect smooth points */
-        if ( point->flags & PSH_POINT_OFF )
-          point->flags |= PSH_POINT_SMOOTH;
+        if ( psh_point_is_off( point ) )
+          psh_point_set_smooth( point );
 
         else if ( point->dir_in == point->dir_out )
         {
           if ( point->dir_out != PSH_DIR_NONE           ||
                psh_corner_is_flat( dxi, dyi, dxo, dyo ) )
-            point->flags |= PSH_POINT_SMOOTH;
+            psh_point_set_smooth( point );
         }
       }
     }



reply via email to

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