summaryrefslogtreecommitdiffstats
path: root/src/cache/ftccmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cache/ftccmap.c')
-rw-r--r--src/cache/ftccmap.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/src/cache/ftccmap.c b/src/cache/ftccmap.c
index b2e9609..b826222 100644
--- a/src/cache/ftccmap.c
+++ b/src/cache/ftccmap.c
@@ -4,7 +4,7 @@
/* */
/* FreeType CharMap cache (body) */
/* */
-/* Copyright 2000-2014 by */
+/* Copyright 2000-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -63,8 +63,6 @@
} FTC_CMapQueryRec, *FTC_CMapQuery;
#define FTC_CMAP_QUERY( x ) ((FTC_CMapQuery)(x))
-#define FTC_CMAP_QUERY_HASH( x ) \
- FTC_CMAP_HASH( (x)->face_id, (x)->cmap_index, (x)->char_code )
/* the cmap cache node */
typedef struct FTC_CMapNodeRec_
@@ -78,8 +76,6 @@
} FTC_CMapNodeRec, *FTC_CMapNode;
#define FTC_CMAP_NODE( x ) ( (FTC_CMapNode)( x ) )
-#define FTC_CMAP_NODE_HASH( x ) \
- FTC_CMAP_HASH( (x)->face_id, (x)->cmap_index, (x)->first )
/* if (indices[n] == FTC_CMAP_UNKNOWN), we assume that the corresponding */
/* glyph indices haven't been queried through FT_Get_Glyph_Index() yet */
@@ -242,7 +238,7 @@
FTC_Node node;
FT_Error error;
FT_UInt gindex = 0;
- FT_PtrDist hash;
+ FT_Offset hash;
FT_Int no_cmap_change = 0;
@@ -263,11 +259,14 @@
return 0;
}
+ if ( !face_id )
+ return 0;
+
query.face_id = face_id;
query.cmap_index = (FT_UInt)cmap_index;
query.char_code = char_code;
- hash = FTC_CMAP_HASH( face_id, cmap_index, char_code );
+ hash = FTC_CMAP_HASH( face_id, (FT_UInt)cmap_index, char_code );
#if 1
FTC_CACHE_LOOKUP_CMP( cache, ftc_cmap_node_compare, hash, &query,
@@ -301,12 +300,6 @@
if ( error )
goto Exit;
-#ifdef FT_MAX_CHARMAP_CACHEABLE
- /* something rotten can happen with rogue clients */
- if ( cmap_index > FT_MAX_CHARMAP_CACHEABLE )
- return 0; /* XXX: should return appropriate error */
-#endif
-
if ( (FT_UInt)cmap_index < (FT_UInt)face->num_charmaps )
{
FT_CharMap old, cmap = NULL;