From 6cc425db912497bdced7004e4b6af0dca2852ca4 Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Sat, 21 Mar 2015 06:51:07 +0100 Subject: [PATCH] [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. --- ChangeLog | 8 ++++++++ src/truetype/ttgxvar.c | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2185d925f..8dc1ce24e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2015-03-21 Werner Lemberg + + [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 * src/base/fttrigon.c (FT_Vector_Rotate): Minor refactoring. diff --git a/src/truetype/ttgxvar.c b/src/truetype/ttgxvar.c index 2652e75f5..77796f051 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++ )