* src/truetype/ttgload.c (TT_Get_Metrics): Add guard for k = 0.
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 39 40 41 42 43 44 45 46 47 48 49 50
diff --git a/ChangeLog b/ChangeLog
index ad28fcd..8e5a7bb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,16 +1,20 @@
-2002-08-20 David Turner <david@freetype.org>
+2002-08-20 Werner Lemberg <wl@gnu.org>
- * src/pshinter/pshalgo1.c, src/pshinter/pshalog2.c,
+ * src/truetype/ttgload.c (TT_Get_Metrics): Add guard for k = 0.
+
+2002-08-20 David Turner <david@freetype.org>
+
+ * src/pshinter/pshalgo1.c, src/pshinter/pshalgo2.c,
src/pshinter/pshglob.c, src/pshinter/pshrec.c,
- src/autohint/ahmodule.c: removing compiler warnings with
- DEBUG_HINTER defined (only used in development builds anyway)
+ src/autohint/ahmodule.c [DEBUG_HINTER]: Removing compiler warnings
+ (only used in development builds anyway).
- * src/pshinter/pshalgo3.h, src/pshinter/pshalgo3.c: removing
+ * src/pshinter/pshalgo3.h, src/pshinter/pshalgo3.c: Removing
compiler warnings, and improving the support of local extrema
- and stem edge points
+ and stem edge points.
- * test/gview.c: small updates to the hinting debugger
- * Jamfile: small updates
+ * test/gview.c: Small updates to the hinting debugger.
+ * Jamfile: Small updates.
2002-08-18 Arkadiusz Miskiewicz <misiek@pld.ORG.PL>
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index 7fb1a0f..526dbbc 100644
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -93,6 +93,12 @@
FT_UShort k = header->number_Of_HMetrics;
+ if (k == 0)
+ {
+ *bearing = *advance = 0;
+ return;
+ }
+
if ( idx < (FT_UInt)k )
{
longs_m = (TT_LongMetrics )header->long_metrics + idx;