summaryrefslogtreecommitdiff
path: root/src/sfnt/ttkern.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sfnt/ttkern.c')
-rw-r--r--src/sfnt/ttkern.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/sfnt/ttkern.c b/src/sfnt/ttkern.c
index 6f9fa52..c97e578 100644
--- a/src/sfnt/ttkern.c
+++ b/src/sfnt/ttkern.c
@@ -5,7 +5,7 @@
/* Load the basic TrueType kerning table. This doesn't handle */
/* kerning data within the GPOS table at the moment. */
/* */
-/* Copyright 1996-2016 by */
+/* Copyright 1996-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -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;