From 40cde69d904eb89fe89fcd7bc4b7d458d113fe6d Mon Sep 17 00:00:00 2001 From: Jjgod Jiang Date: Mon, 4 Aug 2014 19:57:51 +0000 Subject: Fix crash and infinity look caused by r34831 git-svn-id: svn://tug.org/texlive/trunk@34836 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/dvipdfm-x/tt_cmap.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Build/source/texk/dvipdfm-x/tt_cmap.c b/Build/source/texk/dvipdfm-x/tt_cmap.c index db291fbaee4..05a0cb3bd30 100644 --- a/Build/source/texk/dvipdfm-x/tt_cmap.c +++ b/Build/source/texk/dvipdfm-x/tt_cmap.c @@ -1042,7 +1042,8 @@ create_ToUnicode_cmap12 (CMap *cmap, char *used_glyphs, cff_font *cffont) { - USHORT i, gid, ch, count = 0; + ULONG i, ch; + USHORT gid, count = 0; for (i = 0; i < map->nGroups; i++) { for (ch = map->groups[i].startCharCode; @@ -1096,7 +1097,7 @@ create_ToUnicode_cmap (tt_cmap *ttcmap, USHORT i, gid, count = 0; char used_glyphs_copy[8192]; cff_font *cffont = prepare_CIDFont_from_sfnt(sfont); - char is_cidfont = (cffont->flag & FONTTYPE_CIDFONT); + char is_cidfont = cffont && (cffont->flag & FONTTYPE_CIDFONT); cmap = CMap_new(); CMap_set_name (cmap, cmap_name); -- cgit v1.2.3