[sfnt] Minor improvement for handling kern tables.

* src/sfnt/ttkern.c (tt_face_load_kern): Don't check for
cross-stream kerning tables since we reject format 2 tables later
on anyways.
Modify code for limit test...
(tt_face_get_kerning): ... to avoid a limit test here.
This commit is contained in:
Wojciech Mamrak 2017-03-27 09:19:14 +02:00 committed by Werner Lemberg
parent c22a9aa245
commit 565f5a7d19
2 changed files with 13 additions and 4 deletions

View File

@ -1,3 +1,13 @@
2017-03-27 Wojciech Mamrak <wmamrak@gmail.com>
[sfnt] Minor improvement for handling kern tables.
* src/sfnt/ttkern.c (tt_face_load_kern): Don't check for
cross-stream kerning tables since we reject format 2 tables later
on anyways.
Modify code for limit test...
(tt_face_get_kerning): ... to avoid a limit test here.
2017-03-27 Werner Lemberg <wl@gnu.org>
[pcf] Fix compiler warnings.

View File

@ -108,8 +108,8 @@
p_next = p_limit;
/* only use horizontal kerning tables */
if ( ( coverage & ~8U ) != 0x0001 ||
p + 8 > p_limit )
if ( ( coverage & 3U ) != 0x0001 ||
p + 8 > p_next )
goto NextTable;
num_pairs = FT_NEXT_USHORT( p );
@ -214,8 +214,7 @@
if ( ( face->kern_avail_bits & mask ) == 0 )
goto NextTable;
if ( p + 8 > next )
goto NextTable;
FT_ASSERT( p + 8 <= next ); /* tested in tt_face_load_kern */
num_pairs = FT_NEXT_USHORT( p );
p += 6;