summaryrefslogtreecommitdiff
path: root/Build/source
diff options
context:
space:
mode:
authorJjgod Jiang <gzjjgod@gmail.com>2015-04-26 15:19:05 +0000
committerJjgod Jiang <gzjjgod@gmail.com>2015-04-26 15:19:05 +0000
commit68145fae1ff53f501cdf67e3f8b23f145caed43a (patch)
treee8c7e18f2380f90c1f8972aee1a2e26fe764387f /Build/source
parent6777e1886b1c1efe32d6a94e6a510ef80de11fb0 (diff)
Reject invalid font files instead of bail out
git-svn-id: svn://tug.org/texlive/trunk@37055 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source')
-rw-r--r--Build/source/texk/dvipdfm-x/cidtype0.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/Build/source/texk/dvipdfm-x/cidtype0.c b/Build/source/texk/dvipdfm-x/cidtype0.c
index 9749a1fff2a..f7e6b441a40 100644
--- a/Build/source/texk/dvipdfm-x/cidtype0.c
+++ b/Build/source/texk/dvipdfm-x/cidtype0.c
@@ -749,7 +749,10 @@ CIDFont_type0_open (CIDFont *font, const char *name,
if ((sfont->type != SFNT_TYPE_TTC && sfont->type != SFNT_TYPE_POSTSCRIPT) ||
sfnt_read_table_directory(sfont, offset) < 0 ||
(offset = sfnt_find_table_pos(sfont, "CFF ")) == 0) {
- ERROR("Not a CFF/OpenType font (4)?");
+ sfnt_close(sfont);
+ if (fp)
+ DPXFCLOSE(fp);
+ return -1;
}
cffont = cff_open(sfont->stream, offset, opt->index);
@@ -1181,7 +1184,10 @@ CIDFont_type0_t1copen (CIDFont *font, const char *name,
if ((sfont->type != SFNT_TYPE_TTC && sfont->type != SFNT_TYPE_POSTSCRIPT) ||
sfnt_read_table_directory(sfont, offset) < 0 ||
(offset = sfnt_find_table_pos(sfont, "CFF ")) == 0) {
- ERROR("Not a CFF/OpenType font (8)?");
+ sfnt_close(sfont);
+ if (fp)
+ DPXFCLOSE(fp);
+ return -1;
}
cffont = cff_open(fp, offset, opt->index);