Commit 8fc6df1028ba7173fbcc467a4402bb7ef8a84f8f

Alexei Podtelezhnikov 2023-03-17T23:35:10

* src/truetype/ttgload.c (TT_Load_Simple_Glyph): Use for-loop. Even though we never call `TT_Load_Simple_Glyph` with zero contours, out of abundance of precaution, let's handle this case properly.

diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index 4defa87..534026a 100644
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -388,7 +388,7 @@
     cont_limit = cont + n_contours;
 
     last = -1;
-    do
+    for ( ; cont < cont_limit; cont++ )
     {
       *cont = FT_NEXT_SHORT( p );
 
@@ -396,7 +396,7 @@
         goto Invalid_Outline;
 
       last = *cont;
-    } while ( ++cont < cont_limit );
+    }
 
     n_points = last + 1;