[truetype] Make all glyphs in `Zycon' GX font work. * src/truetype/ttgxvar.c (ft_var_readpackedpoints): Fix boundary tests.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
diff --git a/ChangeLog b/ChangeLog
index 5b9df4a..eb2cf79 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2016-07-16 Behdad Esfahbod <behdad@behdad.org>
+
+ [truetype] Make all glyphs in `Zycon' GX font work.
+
+ * src/truetype/ttgxvar.c (ft_var_readpackedpoints): Fix boundary
+ tests.
+
2016-07-16 Werner Lemberg <wl@gnu.org>
[truetype] Fix GX delta tracing.
diff --git a/src/truetype/ttgxvar.c b/src/truetype/ttgxvar.c
index 1ddaa0d..7c85d62 100644
--- 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;
}