ref: ea4c3dc4853aeddbc5364223cf0e825b65cb574e
parent: 96508b74b421cb8f6cb2d2bbb4a1792c6637e221
author: Werner Lemberg <[email protected]>
date: Tue Nov 8 04:10:16 EST 2005
* src/type1/t1afm.c (T1_Read_PFM): Zero offset means `no kerning table available'. From Sergey Tolstov <[email protected]>.
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-11-07 Werner Lemberg <[email protected]>
+
+ * src/type1/t1afm.c (T1_Read_PFM): Zero offset means `no kerning
+ table available'. From Sergey Tolstov <[email protected]>.
+
2005-11-03 Ville Syrj�l� <[email protected]>
* src/base/ftobjs.c (FT_Open_Face): Avoid possible memory leak.
--- a/src/type1/t1afm.c
+++ b/src/type1/t1afm.c
@@ -4,7 +4,7 @@
/* */
/* AFM support for Type 1 fonts (body). */
/* */
-/* Copyright 1996-2001, 2002, 2003, 2004 by */
+/* Copyright 1996-2001, 2002, 2003, 2004, 2005 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -285,6 +285,11 @@
/* Kerning offset is 14 bytes from start of extensions table. */
p += 14;
p = start + LITTLE_ENDIAN_UINT( p );
+
+ if ( p == start )
+ /* zero offset means no table */
+ goto Exit;
+
if ( p + 2 > limit )
{
error = T1_Err_Unknown_File_Format;