[truetype] Improve `gvar' handling. * src/truetype/ttgxvar.c (ft_var_readpackedpoints): Correctly handle single-element runs. Cf. glyph `Q' in Skia.ttf with weights larger than the default.
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
diff --git a/ChangeLog b/ChangeLog
index 2185d92..8dc1ce2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2015-03-21 Werner Lemberg <wl@gnu.org>
+
+ [truetype] Improve `gvar' handling.
+
+ * src/truetype/ttgxvar.c (ft_var_readpackedpoints): Correctly handle
+ single-element runs. Cf. glyph `Q' in Skia.ttf with weights larger
+ than the default.
+
2015-03-20 Alexei Podtelezhnikov <apodtele@gmail.com>
* src/base/fttrigon.c (FT_Vector_Rotate): Minor refactoring.
diff --git a/src/truetype/ttgxvar.c b/src/truetype/ttgxvar.c
index 2652e75..77796f0 100644
--- a/src/truetype/ttgxvar.c
+++ b/src/truetype/ttgxvar.c
@@ -164,7 +164,7 @@
first = FT_GET_USHORT();
points[i++] = first;
- if ( runcnt < 1 || i + runcnt >= n )
+ if ( runcnt < 1 || i + runcnt > n )
goto Exit;
/* first point not included in run count */
@@ -179,7 +179,7 @@
first = FT_GET_BYTE();
points[i++] = first;
- if ( runcnt < 1 || i + runcnt >= n )
+ if ( runcnt < 1 || i + runcnt > n )
goto Exit;
for ( j = 0; j < runcnt; j++ )