* src/truetype/ttgload.c (load_truetype_glyph): Fix test for invalid glyph header.
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 51 52 53 54 55 56 57 58 59 60 61 62 63
diff --git a/ChangeLog b/ChangeLog
index 6d220dd..52c5a9d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2001-12-17 Werner Lemberg <wl@gnu.org>
+
+ * src/truetype/ttgload.c (load_truetype_glyph): Fix test for invalid
+ glyph header.
+
2001-12-15 Werner Lemberg <wl@gnu.org>
* src/base/ftglyph.c (FT_Glyph_To_Bitmap): Remove compiler warning.
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index ff5895e..1a10f2a 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -1873,6 +1873,7 @@
return result;
}
+
/* documentation is in freetype.h */
FT_EXPORT_DEF( FT_Error )
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index 7f1481f..8b586e2 100644
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -723,16 +723,6 @@
if ( index < (FT_UInt)face->num_locations - 1 )
count = face->glyph_locations[index + 1] - offset;
- /* temporary hack */
-#if 1
- if ( count < 10 )
- {
- /* This glyph is corrupted -- it does not have a complete header */
- error = TT_Err_Invalid_Outline;
- goto Fail;
- }
-#endif
-
if ( count == 0 )
{
/* as described by Frederic Loyer, these are spaces, and */
@@ -759,6 +749,16 @@
goto Exit;
}
+ /* temporary hack */
+#if 1
+ if ( count < 10 )
+ {
+ /* This glyph is corrupted -- it does not have a complete header */
+ error = TT_Err_Invalid_Outline;
+ goto Fail;
+ }
+#endif
+
offset = loader->glyf_offset + offset;
/* access glyph frame */