Commit b0e0db116d99103ab1cad4e07e9460156d6d81f4

David Turner 2006-02-23T23:03:39

another hack

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/src/cache/ftccmap.c b/src/cache/ftccmap.c
index d235f28..bdbbe74 100644
--- a/src/cache/ftccmap.c
+++ b/src/cache/ftccmap.c
@@ -375,6 +375,10 @@
 
     FT_ASSERT( (FT_UInt)( char_code - node->first ) < FTC_CMAP_INDICES_MAX );
 
+    /* something rotten can happen with rogue clients */
+    if ( (FT_UInt)( char_code - node->first >= FTC_CMAP_INDICES_MAX )
+      return 0;
+
     gindex = node->indices[char_code - node->first];
     if ( gindex == FTC_CMAP_UNKNOWN )
     {