shithub: freetype+ttf2subf

Download patch

ref: 69446ddccec76a1660284ea37e6a89556e06be82
parent: a3b61253a7001a664c68ce0233047bd121330534
author: Behdad Esfahbod <[email protected]>
date: Sat Jul 16 06:52:38 EDT 2016

[truetype] Make all glyphs in `Zycon' GX font work.

* src/truetype/ttgxvar.c (ft_var_readpackedpoints): Fix boundary
tests.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2016-07-16  Behdad Esfahbod  <[email protected]>
+
+	[truetype] Make all glyphs in `Zycon' GX font work.
+
+	* src/truetype/ttgxvar.c (ft_var_readpackedpoints): Fix boundary
+	tests.
+
 2016-07-16  Werner Lemberg  <[email protected]>
 
 	[truetype] Fix GX delta tracing.
--- a/src/truetype/ttgxvar.c
+++ b/src/truetype/ttgxvar.c
@@ -174,14 +174,13 @@
         first      += FT_GET_USHORT();
         points[i++] = first;
 
-        if ( runcnt < 1 || i + runcnt > n )
-          goto Exit;
-
         /* first point not included in run count */
         for ( j = 0; j < runcnt; j++ )
         {
           first      += FT_GET_USHORT();
           points[i++] = first;
+          if ( i == n )
+            break;
         }
       }
       else
@@ -189,18 +188,16 @@
         first      += FT_GET_BYTE();
         points[i++] = first;
 
-        if ( runcnt < 1 || i + runcnt > n )
-          goto Exit;
-
         for ( j = 0; j < runcnt; j++ )
         {
           first      += FT_GET_BYTE();
           points[i++] = first;
+          if ( i == n )
+            break;
         }
       }
     }
 
-  Exit:
     return points;
   }