Commit 22b1d5ca6772b155eaad79b0e0b406e308bd0d86

Werner Lemberg 2015-02-22T20:41:03

[pshinter] Fix thinko. * src/pshinter/pshalgo.c (psh_glyph_find_strong_points): Correctly check `count'. Bug introduced two commits earlier.

diff --git a/ChangeLog b/ChangeLog
index e832dbf..c06a10e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2015-02-22  Werner Lemberg  <wl@gnu.org>
 
+	[pshinter] Fix thinko.
+
+	* src/pshinter/pshalgo.c (psh_glyph_find_strong_points): Correctly
+	check `count'.
+	Bug introduced two commits earlier.
+
+2015-02-22  Werner Lemberg  <wl@gnu.org>
+
 	[raster] Signedness fixes.
 
 	* src/raster/ftraster.c, src/raster/ftrend1.c: Apply.
diff --git a/src/pshinter/pshalgo.c b/src/pshinter/pshalgo.c
index d36600e..d04d120 100644
--- a/src/pshinter/pshalgo.c
+++ b/src/pshinter/pshalgo.c
@@ -1696,14 +1696,12 @@
       mask++;
       for ( ; num_masks > 1; num_masks--, mask++ )
       {
-        FT_UInt  next;
-        FT_UInt  count;
+        FT_UInt  next = FT_MIN( mask->end_point, glyph->num_points );
 
 
-        next  = FT_MIN( mask->end_point, glyph->num_points );
-        count = next - first;
-        if ( count > 0 )
+        if ( next > first )
         {
+          FT_UInt    count = next - first;
           PSH_Point  point = glyph->points + first;