diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2020-07-30 22:47:03 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2020-07-30 22:47:03 +0000 |
commit | e3231938212423e5e71506e58022397ff69cd34b (patch) | |
tree | e0fcbb8e953a4f58fe51564f83308635999604f5 /Build/source/texk/dvipdfm-x/tt_cmap.c | |
parent | 1adec16a2d8fa1f86d601d124f85d7817bd4f233 (diff) |
More fix to the previous fix for tt_cmap.c. Fix for a possible problem in cid.c. (S. Hirara)
git-svn-id: svn://tug.org/texlive/trunk@55999 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvipdfm-x/tt_cmap.c')
-rw-r--r-- | Build/source/texk/dvipdfm-x/tt_cmap.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Build/source/texk/dvipdfm-x/tt_cmap.c b/Build/source/texk/dvipdfm-x/tt_cmap.c index 3e9fea7274d..113d11699a5 100644 --- a/Build/source/texk/dvipdfm-x/tt_cmap.c +++ b/Build/source/texk/dvipdfm-x/tt_cmap.c @@ -1605,17 +1605,20 @@ otf_try_load_GID_to_CID_map (const char *map_name, int ttc_index, int wmode) ULONG offset = 0; char *cmap_name = NULL; FILE *fp = NULL; + int len; if (!map_name) return -1; - if (ttc_index > 999 || ttc_index < 0) { - return -1; /* Sorry for this... */ + if (ttc_index > 0xFFFFFFFFu || ttc_index < 0) { + return -1; } /* Check if already loaded */ - cmap_name = NEW(strlen(map_name)+strlen("-GID")+5, char); - sprintf(cmap_name, "%s:%d-%d-GID", map_name, ttc_index, wmode); + len = strlen(map_name) + 32; + cmap_name = NEW(len, char); + snprintf(cmap_name, len, "%s:%d-%1d-GID", map_name, ttc_index, wmode); + cmap_name[len-1] = '\0'; cmap_id = CMap_cache_find(cmap_name); if (cmap_id >= 0) { RELEASE(cmap_name); |