diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2012-04-27 13:11:55 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2012-04-27 13:11:55 +0000 |
commit | 4cff2654a7dd5b9f1ca98699cc75d6c8b8c763a8 (patch) | |
tree | 8c522514a54dfa93a30d29a94cd2c667c38d078f /Build/source/texk/dvipdfmx | |
parent | cf5698840040d0111b1ebba692bc58093a39d7eb (diff) |
(x)dvipdfmx: Reduce differences between these two
git-svn-id: svn://tug.org/texlive/trunk@26149 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvipdfmx')
8 files changed, 515 insertions, 47 deletions
diff --git a/Build/source/texk/dvipdfmx/dvipdfmx-20120420-PATCHES/ChangeLog b/Build/source/texk/dvipdfmx/dvipdfmx-20120420-PATCHES/ChangeLog index bcac474b580..c6cab2ea57b 100644 --- a/Build/source/texk/dvipdfmx/dvipdfmx-20120420-PATCHES/ChangeLog +++ b/Build/source/texk/dvipdfmx/dvipdfmx-20120420-PATCHES/ChangeLog @@ -1,3 +1,10 @@ +2012-04-27 Peter Breitenlohner <peb@mppmu.mpg.de> + + * patch-03-trivial (new): Reduce differences between dvipdfmx + and xdvipdfmx: + * cid.c, cidtype[02].c, truetype.c, tt_cmap.c, type1c.c: + Trivial modifications. + 2012-04-25 Peter Breitenlohner <peb@mppmu.mpg.de> * patch-02-MEM_DEBUG (new): Try to avoid mem_debug_check warning. diff --git a/Build/source/texk/dvipdfmx/dvipdfmx-20120420-PATCHES/patch-03-trivial b/Build/source/texk/dvipdfmx/dvipdfmx-20120420-PATCHES/patch-03-trivial new file mode 100644 index 00000000000..b6f6ea7bd08 --- /dev/null +++ b/Build/source/texk/dvipdfmx/dvipdfmx-20120420-PATCHES/patch-03-trivial @@ -0,0 +1,437 @@ +diff -ur dvipdfmx-20120420.orig/src/cid.c dvipdfmx-20120420/src/cid.c +--- dvipdfmx-20120420.orig/src/cid.c 2011-03-07 18:11:26.000000000 +0100 ++++ dvipdfmx-20120420/src/cid.c 2012-04-27 13:35:25.000000000 +0200 +@@ -70,7 +70,7 @@ + {"Adobe", "Japan1", {-1, -1, 2, 2, 4, 5, 6, 6}}, + {"Adobe", "Korea1", {-1, -1, 1, 1, 2, 2, 2, 2}}, + {"Adobe", "Identity", {-1, -1, 0, 0, 0, 0, 0, 0}}, +- {NULL, NULL, {0,0,0,0,0,0,0,0}} ++ {NULL, NULL, { 0, 0, 0, 0, 0, 0, 0, 0}} + }; + #define UCS_CC 0 + #define ACC_START 1 +diff -ur dvipdfmx-20120420.orig/src/cidtype0.c dvipdfmx-20120420/src/cidtype0.c +--- dvipdfmx-20120420.orig/src/cidtype0.c 2011-03-07 18:11:26.000000000 +0100 ++++ dvipdfmx-20120420/src/cidtype0.c 2012-04-27 13:33:11.000000000 +0200 +@@ -467,7 +467,7 @@ + { + sfnt *sfont; + cff_font *cffont; +- FILE *fp; ++ FILE *fp = NULL; + cff_index *charstrings, *idx; + cff_charsets *charset = NULL; + cff_fdselect *fdselect = NULL; +@@ -571,7 +571,8 @@ + RELEASE(CIDToGIDMap); + cff_close(cffont); + sfnt_close(sfont); +- DPXFCLOSE(fp); ++ if (fp) ++ DPXFCLOSE(fp); + + return; + } +@@ -689,7 +690,8 @@ + + cff_close(cffont); + sfnt_close(sfont); +- DPXFCLOSE(fp); ++ if (fp) ++ DPXFCLOSE(fp); + + if (verbose > 1) + MESG("[%u/%u glyphs][%ld bytes]", num_glyphs, cs_count, destlen); +@@ -719,7 +721,7 @@ + char *fontname; + sfnt *sfont; + cff_font *cffont; +- FILE *fp; ++ FILE *fp = NULL; + unsigned long offset = 0; + + ASSERT(font); +@@ -746,7 +748,8 @@ + if (!(cffont->flag & FONTTYPE_CIDFONT)) { + cff_close(cffont); + sfnt_close(sfont); +- DPXFCLOSE(fp); ++ if (fp) ++ DPXFCLOSE(fp); + return -1; + } + +@@ -819,7 +822,7 @@ + /* getting font info. from TrueType tables */ + if ((font->descriptor + = tt_get_fontdesc(sfont, &(opt->embed), opt->stemv, 0)) == NULL) +- ERROR("Could not obtain neccesary font info."); ++ ERROR("Could not obtain necessary font info."); + + if (opt->embed) { + memmove(fontname + 7, fontname, strlen(fontname) + 1); +@@ -851,7 +854,8 @@ + pdf_new_number(1000)); /* not sure */ + + sfnt_close(sfont); +- DPXFCLOSE(fp); ++ if (fp) ++ DPXFCLOSE(fp); + + return 0; + } +@@ -871,7 +875,7 @@ + int parent_id; + char *used_chars; + double default_width, nominal_width; +- FILE *fp; ++ FILE *fp = NULL; + + ASSERT(font); + +@@ -1102,7 +1106,8 @@ + } + + sfnt_close(sfont); +- DPXFCLOSE(fp); ++ if (fp) ++ DPXFCLOSE(fp); + + if (verbose > 1) + MESG("[%u glyphs][%ld bytes]", num_glyphs, destlen); +@@ -1133,7 +1138,7 @@ + sfnt *sfont; + cff_font *cffont; + unsigned long offset = 0; +- FILE *fp; ++ FILE *fp = NULL; + + ASSERT(font); + +@@ -1159,7 +1164,8 @@ + if (cffont->flag & FONTTYPE_CIDFONT) { + cff_close(cffont); + sfnt_close(sfont); +- DPXFCLOSE(fp); ++ if (fp) ++ DPXFCLOSE(fp); + + return -1; + } +@@ -1218,7 +1224,7 @@ + /* getting font info. from TrueType tables */ + if ((font->descriptor + = tt_get_fontdesc(sfont, &(opt->embed), opt->stemv, 0)) == NULL) +- ERROR("Could not obtain neccesary font info."); ++ ERROR("Could not obtain necessary font info."); + + if (opt->embed) { + memmove(fontname + 7, fontname, strlen(fontname) + 1); +@@ -1246,7 +1252,8 @@ + pdf_add_dict(font->fontdict, pdf_new_name("CIDSystemInfo"), csi_dict); + } + sfnt_close(sfont); +- DPXFCLOSE(fp); ++ if (fp) ++ DPXFCLOSE(fp); + + return 0; + } +@@ -1372,11 +1379,9 @@ + return -1; + + cffont = t1_load_font(NULL, 1, fp); +- if (!cffont) { +- DPXFCLOSE(fp); +- return -1; +- } + DPXFCLOSE(fp); ++ if (!cffont) ++ return -1; + + cmap_id = load_base_CMap(font_name, wmode, cffont); + +diff -ur dvipdfmx-20120420.orig/src/cidtype2.c dvipdfmx-20120420/src/cidtype2.c +--- dvipdfmx-20120420.orig/src/cidtype2.c 2011-03-07 18:11:26.000000000 +0100 ++++ dvipdfmx-20120420/src/cidtype2.c 2012-04-27 13:42:54.000000000 +0200 +@@ -498,7 +498,7 @@ + unsigned char *cidtogidmap; + USHORT num_glyphs; + int i, glyph_ordering = 0, unicode_cmap = 0; +- FILE *fp; ++ FILE *fp = NULL; + + if (!font->indirect) + return; +@@ -853,7 +853,8 @@ + if (cidtogidmap) + RELEASE(cidtogidmap); + sfnt_close(sfont); +- DPXFCLOSE(fp); ++ if (fp) ++ DPXFCLOSE(fp); + + return; + } +@@ -873,7 +874,8 @@ + fontfile = sfnt_create_FontFile_stream(sfont); + + sfnt_close(sfont); +- DPXFCLOSE(fp); ++ if (fp) ++ DPXFCLOSE(fp); + + if (!fontfile) + ERROR("Could not created FontFile stream for \"%s\".", font->ident); +@@ -926,7 +928,7 @@ + char *fontname; + sfnt *sfont; + unsigned long offset = 0; +- FILE *fp; ++ FILE *fp = NULL; + + ASSERT(font && opt); + +@@ -960,7 +962,8 @@ + break; + default: + sfnt_close(sfont); +- DPXFCLOSE(fp); ++ if (fp) ++ DPXFCLOSE(fp); + return -1; + break; + } +@@ -1059,7 +1062,7 @@ + + font->descriptor = tt_get_fontdesc(sfont, &(opt->embed), opt->stemv, 0); + if (!font->descriptor) { +- ERROR("Could not obtain neccesary font info."); ++ ERROR("Could not obtain necessary font info."); + } + + if (opt->embed) { +@@ -1076,7 +1079,8 @@ + pdf_new_name(fontname)); + + sfnt_close(sfont); +- DPXFCLOSE(fp); ++ if (fp) ++ DPXFCLOSE(fp); + + /* + * Don't write fontdict here. +diff -ur dvipdfmx-20120420.orig/src/truetype.c dvipdfmx-20120420/src/truetype.c +--- dvipdfmx-20120420.orig/src/truetype.c 2011-03-07 18:11:26.000000000 +0100 ++++ dvipdfmx-20120420/src/truetype.c 2012-04-27 14:28:16.000000000 +0200 +@@ -68,7 +68,7 @@ + pdf_obj *fontdict, *descriptor; + sfnt *sfont; + int embedding = 1; /* Must be embedded. */ +- FILE *fp; ++ FILE *fp = NULL; + int length, error = 0; + + ASSERT( font ); +@@ -89,7 +89,8 @@ + + if (!sfont) { + WARN("Could not open TrueType font: %s", ident); +- DPXFCLOSE(fp); ++ if (fp) ++ DPXFCLOSE(fp); + return -1; + } + +@@ -104,7 +105,8 @@ + + if (error) { + sfnt_close(sfont); +- DPXFCLOSE(fp); ++ if (fp) ++ DPXFCLOSE(fp); + return -1; /* Silently */ + } + +@@ -124,9 +126,10 @@ + pdf_obj *tmp; + tmp = tt_get_fontdesc(sfont, &embedding, -1, 1); + if (!tmp) { +- ERROR("Could not obtain neccesary font info."); ++ ERROR("Could not obtain necessary font info."); + sfnt_close(sfont); +- DPXFCLOSE(fp); ++ if (fp) ++ DPXFCLOSE(fp); + return -1; + } + ASSERT(pdf_obj_typeof(tmp) == PDF_DICT); +@@ -189,7 +192,8 @@ + } + + sfnt_close(sfont); +- DPXFCLOSE(fp); ++ if (fp) ++ DPXFCLOSE(fp); + + pdf_add_dict(fontdict, + pdf_new_name("Type"), pdf_new_name("Font")); +@@ -882,7 +886,7 @@ + int index = pdf_font_get_index(font); + char **enc_vec; + pdf_obj *fontfile; +- FILE *fp; ++ FILE *fp = NULL; + sfnt *sfont; + int i, error = 0; + +@@ -902,14 +906,16 @@ + + if (!sfont) { + ERROR("Unable to open TrueType/dfont file: %s", ident); +- DPXFCLOSE(fp); ++ if (fp) ++ DPXFCLOSE(fp); + return -1; + } else if (sfont->type != SFNT_TYPE_TRUETYPE && + sfont->type != SFNT_TYPE_TTC && + sfont->type != SFNT_TYPE_DFONT) { + ERROR("Font \"%s\" not a TrueType/dfont font?", ident); + sfnt_close(sfont); +- DPXFCLOSE(fp); ++ if (fp) ++ DPXFCLOSE(fp); + return -1; + } + +@@ -925,7 +931,8 @@ + if (error) { + ERROR("Reading SFND table dir failed for font-file=\"%s\"... Not a TrueType font?", ident); + sfnt_close(sfont); +- DPXFCLOSE(fp); ++ if (fp) ++ DPXFCLOSE(fp); + return -1; + } + +@@ -941,14 +948,16 @@ + if (error) { + ERROR("Error occured while creating font subfont for \"%s\"", ident); + sfnt_close(sfont); +- DPXFCLOSE(fp); ++ if (fp) ++ DPXFCLOSE(fp); + return -1; + } + + #if ENABLE_NOEMBED + if (!embedding) { + sfnt_close(sfont); +- DPXFCLOSE(fp); ++ if (fp) ++ DPXFCLOSE(fp); + return 0; + } + #endif /* ENABLE_NOEMBED */ +@@ -964,7 +973,8 @@ + ERROR("Required TrueType table \"%s\" does not exist in font: %s", + required_table[i].name, ident); + sfnt_close(sfont); +- DPXFCLOSE(fp); ++ if (fp) ++ DPXFCLOSE(fp); + return -1; + } + } +@@ -977,7 +987,8 @@ + ERROR("Could not created FontFile stream for \"%s\".", ident); + + sfnt_close(sfont); +- DPXFCLOSE(fp); ++ if (fp) ++ DPXFCLOSE(fp); + + if (verbose > 1) + MESG("[%ld bytes]", pdf_stream_length(fontfile)); +diff -ur dvipdfmx-20120420.orig/src/tt_cmap.c dvipdfmx-20120420/src/tt_cmap.c +--- dvipdfmx-20120420.orig/src/tt_cmap.c 2011-10-19 09:10:39.000000000 +0200 ++++ dvipdfmx-20120420/src/tt_cmap.c 2012-04-27 14:46:54.000000000 +0200 +@@ -1029,7 +1029,7 @@ + int cmap_add_id; + tt_cmap *ttcmap; + char *cmap_name; +- FILE *fp; ++ FILE *fp = NULL; + sfnt *sfont; + long offset = 0; + +@@ -1124,7 +1124,8 @@ + RELEASE(cmap_name); + + sfnt_close(sfont); +- DPXFCLOSE(fp); ++ if (fp) ++ DPXFCLOSE(fp); + + return cmap_ref; + } +@@ -1601,7 +1602,7 @@ + unsigned long offset = 0; + char *base_name = NULL, *cmap_name = NULL; + char *tounicode_name = NULL; +- FILE *fp; ++ FILE *fp = NULL; + otl_gsub *gsub_list = NULL; + tt_cmap *ttcmap; + CMap *cmap, *base, *tounicode = NULL; +diff -ur dvipdfmx-20120420.orig/src/type1c.c dvipdfmx-20120420/src/type1c.c +--- dvipdfmx-20120420.orig/src/type1c.c 2010-04-05 02:34:08.000000000 +0200 ++++ dvipdfmx-20120420/src/type1c.c 2012-04-27 14:34:55.000000000 +0200 +@@ -70,7 +70,7 @@ + pdf_font_open_type1c (pdf_font *font) + { + char *ident, *fontname; +- FILE *fp; ++ FILE *fp = NULL; + sfnt *sfont; + cff_font *cffont; + pdf_obj *descriptor, *tmp; +@@ -106,7 +106,8 @@ + if (cffont->flag & FONTTYPE_CIDFONT) { + cff_close (cffont); + sfnt_close(sfont); +- DPXFCLOSE(fp); ++ if (fp) ++ DPXFCLOSE(fp); + return -1; + } + +@@ -149,7 +150,8 @@ + } + + sfnt_close(sfont); +- DPXFCLOSE(fp); ++ if (fp) ++ DPXFCLOSE(fp); + + return 0; + } +@@ -230,7 +232,7 @@ + pdf_obj *fontdict, *descriptor; + char *usedchars; + char *fontname, *uniqueTag, *ident, *fullname; +- FILE *fp; ++ FILE *fp = NULL; + int encoding_id; + pdf_obj *fontfile, *stream_dict; + char **enc_vec; +@@ -708,7 +710,8 @@ + cff_close (cffont); + sfnt_close(sfont); + +- DPXFCLOSE(fp); ++ if (fp) ++ DPXFCLOSE(fp); + + if (verbose > 1) { + MESG("[%u/%u glyphs][%ld bytes]", num_glyphs, cs_count, offset); diff --git a/Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/cid.c b/Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/cid.c index 72828782dc5..6d790ec6f22 100644 --- a/Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/cid.c +++ b/Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/cid.c @@ -70,7 +70,7 @@ static struct { {"Adobe", "Japan1", {-1, -1, 2, 2, 4, 5, 6, 6}}, {"Adobe", "Korea1", {-1, -1, 1, 1, 2, 2, 2, 2}}, {"Adobe", "Identity", {-1, -1, 0, 0, 0, 0, 0, 0}}, - {NULL, NULL, {0,0,0,0,0,0,0,0}} + {NULL, NULL, { 0, 0, 0, 0, 0, 0, 0, 0}} }; #define UCS_CC 0 #define ACC_START 1 diff --git a/Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/cidtype0.c b/Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/cidtype0.c index a76929fac90..bccc34ba25a 100644 --- a/Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/cidtype0.c +++ b/Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/cidtype0.c @@ -467,7 +467,7 @@ CIDFont_type0_dofont (CIDFont *font) { sfnt *sfont; cff_font *cffont; - FILE *fp; + FILE *fp = NULL; cff_index *charstrings, *idx; cff_charsets *charset = NULL; cff_fdselect *fdselect = NULL; @@ -571,7 +571,8 @@ CIDFont_type0_dofont (CIDFont *font) RELEASE(CIDToGIDMap); cff_close(cffont); sfnt_close(sfont); - DPXFCLOSE(fp); + if (fp) + DPXFCLOSE(fp); return; } @@ -689,7 +690,8 @@ CIDFont_type0_dofont (CIDFont *font) cff_close(cffont); sfnt_close(sfont); - DPXFCLOSE(fp); + if (fp) + DPXFCLOSE(fp); if (verbose > 1) MESG("[%u/%u glyphs][%ld bytes]", num_glyphs, cs_count, destlen); @@ -719,7 +721,7 @@ CIDFont_type0_open (CIDFont *font, const char *name, char *fontname; sfnt *sfont; cff_font *cffont; - FILE *fp; + FILE *fp = NULL; unsigned long offset = 0; ASSERT(font); @@ -746,7 +748,8 @@ CIDFont_type0_open (CIDFont *font, const char *name, if (!(cffont->flag & FONTTYPE_CIDFONT)) { cff_close(cffont); sfnt_close(sfont); - DPXFCLOSE(fp); + if (fp) + DPXFCLOSE(fp); return -1; } @@ -819,7 +822,7 @@ CIDFont_type0_open (CIDFont *font, const char *name, /* getting font info. from TrueType tables */ if ((font->descriptor = tt_get_fontdesc(sfont, &(opt->embed), opt->stemv, 0)) == NULL) - ERROR("Could not obtain neccesary font info."); + ERROR("Could not obtain necessary font info."); if (opt->embed) { memmove(fontname + 7, fontname, strlen(fontname) + 1); @@ -851,7 +854,8 @@ CIDFont_type0_open (CIDFont *font, const char *name, pdf_new_number(1000)); /* not sure */ sfnt_close(sfont); - DPXFCLOSE(fp); + if (fp) + DPXFCLOSE(fp); return 0; } @@ -871,7 +875,7 @@ CIDFont_type0_t1cdofont (CIDFont *font) int parent_id; char *used_chars; double default_width, nominal_width; - FILE *fp; + FILE *fp = NULL; ASSERT(font); @@ -1102,7 +1106,8 @@ CIDFont_type0_t1cdofont (CIDFont *font) } sfnt_close(sfont); - DPXFCLOSE(fp); + if (fp) + DPXFCLOSE(fp); if (verbose > 1) MESG("[%u glyphs][%ld bytes]", num_glyphs, destlen); @@ -1133,7 +1138,7 @@ CIDFont_type0_t1copen (CIDFont *font, const char *name, sfnt *sfont; cff_font *cffont; unsigned long offset = 0; - FILE *fp; + FILE *fp = NULL; ASSERT(font); @@ -1159,7 +1164,8 @@ CIDFont_type0_t1copen (CIDFont *font, const char *name, if (cffont->flag & FONTTYPE_CIDFONT) { cff_close(cffont); sfnt_close(sfont); - DPXFCLOSE(fp); + if (fp) + DPXFCLOSE(fp); return -1; } @@ -1218,7 +1224,7 @@ CIDFont_type0_t1copen (CIDFont *font, const char *name, /* getting font info. from TrueType tables */ if ((font->descriptor = tt_get_fontdesc(sfont, &(opt->embed), opt->stemv, 0)) == NULL) - ERROR("Could not obtain neccesary font info."); + ERROR("Could not obtain necessary font info."); if (opt->embed) { memmove(fontname + 7, fontname, strlen(fontname) + 1); @@ -1246,7 +1252,8 @@ CIDFont_type0_t1copen (CIDFont *font, const char *name, pdf_add_dict(font->fontdict, pdf_new_name("CIDSystemInfo"), csi_dict); } sfnt_close(sfont); - DPXFCLOSE(fp); + if (fp) + DPXFCLOSE(fp); return 0; } @@ -1372,11 +1379,9 @@ t1_load_UnicodeCMap (const char *font_name, return -1; cffont = t1_load_font(NULL, 1, fp); - if (!cffont) { - DPXFCLOSE(fp); - return -1; - } DPXFCLOSE(fp); + if (!cffont) + return -1; cmap_id = load_base_CMap(font_name, wmode, cffont); diff --git a/Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/cidtype2.c b/Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/cidtype2.c index 91cf66db27f..9408772533f 100644 --- a/Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/cidtype2.c +++ b/Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/cidtype2.c @@ -498,7 +498,7 @@ CIDFont_type2_dofont (CIDFont *font) unsigned char *cidtogidmap; USHORT num_glyphs; int i, glyph_ordering = 0, unicode_cmap = 0; - FILE *fp; + FILE *fp = NULL; if (!font->indirect) return; @@ -853,7 +853,8 @@ CIDFont_type2_dofont (CIDFont *font) if (cidtogidmap) RELEASE(cidtogidmap); sfnt_close(sfont); - DPXFCLOSE(fp); + if (fp) + DPXFCLOSE(fp); return; } @@ -873,7 +874,8 @@ CIDFont_type2_dofont (CIDFont *font) fontfile = sfnt_create_FontFile_stream(sfont); sfnt_close(sfont); - DPXFCLOSE(fp); + if (fp) + DPXFCLOSE(fp); if (!fontfile) ERROR("Could not created FontFile stream for \"%s\".", font->ident); @@ -926,7 +928,7 @@ CIDFont_type2_open (CIDFont *font, const char *name, char *fontname; sfnt *sfont; unsigned long offset = 0; - FILE *fp; + FILE *fp = NULL; ASSERT(font && opt); @@ -960,7 +962,8 @@ CIDFont_type2_open (CIDFont *font, const char *name, break; default: sfnt_close(sfont); - DPXFCLOSE(fp); + if (fp) + DPXFCLOSE(fp); return -1; break; } @@ -1059,7 +1062,7 @@ CIDFont_type2_open (CIDFont *font, const char *name, font->descriptor = tt_get_fontdesc(sfont, &(opt->embed), opt->stemv, 0); if (!font->descriptor) { - ERROR("Could not obtain neccesary font info."); + ERROR("Could not obtain necessary font info."); } if (opt->embed) { @@ -1076,7 +1079,8 @@ CIDFont_type2_open (CIDFont *font, const char *name, pdf_new_name(fontname)); sfnt_close(sfont); - DPXFCLOSE(fp); + if (fp) + DPXFCLOSE(fp); /* * Don't write fontdict here. diff --git a/Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/truetype.c b/Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/truetype.c index 9ba07b0993d..9a88efc0f0b 100644 --- a/Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/truetype.c +++ b/Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/truetype.c @@ -68,7 +68,7 @@ pdf_font_open_truetype (pdf_font *font) pdf_obj *fontdict, *descriptor; sfnt *sfont; int embedding = 1; /* Must be embedded. */ - FILE *fp; + FILE *fp = NULL; int length, error = 0; ASSERT( font ); @@ -89,7 +89,8 @@ pdf_font_open_truetype (pdf_font *font) if (!sfont) { WARN("Could not open TrueType font: %s", ident); - DPXFCLOSE(fp); + if (fp) + DPXFCLOSE(fp); return -1; } @@ -104,7 +105,8 @@ pdf_font_open_truetype (pdf_font *font) if (error) { sfnt_close(sfont); - DPXFCLOSE(fp); + if (fp) + DPXFCLOSE(fp); return -1; /* Silently */ } @@ -124,9 +126,10 @@ pdf_font_open_truetype (pdf_font *font) pdf_obj *tmp; tmp = tt_get_fontdesc(sfont, &embedding, -1, 1); if (!tmp) { - ERROR("Could not obtain neccesary font info."); + ERROR("Could not obtain necessary font info."); sfnt_close(sfont); - DPXFCLOSE(fp); + if (fp) + DPXFCLOSE(fp); return -1; } ASSERT(pdf_obj_typeof(tmp) == PDF_DICT); @@ -189,7 +192,8 @@ pdf_font_open_truetype (pdf_font *font) } sfnt_close(sfont); - DPXFCLOSE(fp); + if (fp) + DPXFCLOSE(fp); pdf_add_dict(fontdict, pdf_new_name("Type"), pdf_new_name("Font")); @@ -882,7 +886,7 @@ pdf_font_load_truetype (pdf_font *font) int index = pdf_font_get_index(font); char **enc_vec; pdf_obj *fontfile; - FILE *fp; + FILE *fp = NULL; sfnt *sfont; int i, error = 0; @@ -902,14 +906,16 @@ pdf_font_load_truetype (pdf_font *font) if (!sfont) { ERROR("Unable to open TrueType/dfont file: %s", ident); - DPXFCLOSE(fp); + if (fp) + DPXFCLOSE(fp); return -1; } else if (sfont->type != SFNT_TYPE_TRUETYPE && sfont->type != SFNT_TYPE_TTC && sfont->type != SFNT_TYPE_DFONT) { ERROR("Font \"%s\" not a TrueType/dfont font?", ident); sfnt_close(sfont); - DPXFCLOSE(fp); + if (fp) + DPXFCLOSE(fp); return -1; } @@ -925,7 +931,8 @@ pdf_font_load_truetype (pdf_font *font) if (error) { ERROR("Reading SFND table dir failed for font-file=\"%s\"... Not a TrueType font?", ident); sfnt_close(sfont); - DPXFCLOSE(fp); + if (fp) + DPXFCLOSE(fp); return -1; } @@ -941,14 +948,16 @@ pdf_font_load_truetype (pdf_font *font) if (error) { ERROR("Error occured while creating font subfont for \"%s\"", ident); sfnt_close(sfont); - DPXFCLOSE(fp); + if (fp) + DPXFCLOSE(fp); return -1; } #if ENABLE_NOEMBED if (!embedding) { sfnt_close(sfont); - DPXFCLOSE(fp); + if (fp) + DPXFCLOSE(fp); return 0; } #endif /* ENABLE_NOEMBED */ @@ -964,7 +973,8 @@ pdf_font_load_truetype (pdf_font *font) ERROR("Required TrueType table \"%s\" does not exist in font: %s", required_table[i].name, ident); sfnt_close(sfont); - DPXFCLOSE(fp); + if (fp) + DPXFCLOSE(fp); return -1; } } @@ -977,7 +987,8 @@ pdf_font_load_truetype (pdf_font *font) ERROR("Could not created FontFile stream for \"%s\".", ident); sfnt_close(sfont); - DPXFCLOSE(fp); + if (fp) + DPXFCLOSE(fp); if (verbose > 1) MESG("[%ld bytes]", pdf_stream_length(fontfile)); diff --git a/Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/tt_cmap.c b/Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/tt_cmap.c index 7b4d5bee947..4b4a8491879 100644 --- a/Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/tt_cmap.c +++ b/Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/tt_cmap.c @@ -1029,7 +1029,7 @@ otf_create_ToUnicode_stream (const char *font_name, int cmap_add_id; tt_cmap *ttcmap; char *cmap_name; - FILE *fp; + FILE *fp = NULL; sfnt *sfont; long offset = 0; @@ -1124,7 +1124,8 @@ otf_create_ToUnicode_stream (const char *font_name, RELEASE(cmap_name); sfnt_close(sfont); - DPXFCLOSE(fp); + if (fp) + DPXFCLOSE(fp); return cmap_ref; } @@ -1601,7 +1602,7 @@ otf_load_Unicode_CMap (const char *map_name, int ttc_index, /* 0 for non-TTC fon unsigned long offset = 0; char *base_name = NULL, *cmap_name = NULL; char *tounicode_name = NULL; - FILE *fp; + FILE *fp = NULL; otl_gsub *gsub_list = NULL; tt_cmap *ttcmap; CMap *cmap, *base, *tounicode = NULL; diff --git a/Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/type1c.c b/Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/type1c.c index 081f0a4870b..2681befc178 100644 --- a/Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/type1c.c +++ b/Build/source/texk/dvipdfmx/dvipdfmx-20120420/src/type1c.c @@ -70,7 +70,7 @@ int pdf_font_open_type1c (pdf_font *font) { char *ident, *fontname; - FILE *fp; + FILE *fp = NULL; sfnt *sfont; cff_font *cffont; pdf_obj *descriptor, *tmp; @@ -106,7 +106,8 @@ pdf_font_open_type1c (pdf_font *font) if (cffont->flag & FONTTYPE_CIDFONT) { cff_close (cffont); sfnt_close(sfont); - DPXFCLOSE(fp); + if (fp) + DPXFCLOSE(fp); return -1; } @@ -149,7 +150,8 @@ pdf_font_open_type1c (pdf_font *font) } sfnt_close(sfont); - DPXFCLOSE(fp); + if (fp) + DPXFCLOSE(fp); return 0; } @@ -230,7 +232,7 @@ pdf_font_load_type1c (pdf_font *font) pdf_obj *fontdict, *descriptor; char *usedchars; char *fontname, *uniqueTag, *ident, *fullname; - FILE *fp; + FILE *fp = NULL; int encoding_id; pdf_obj *fontfile, *stream_dict; char **enc_vec; @@ -708,7 +710,8 @@ pdf_font_load_type1c (pdf_font *font) cff_close (cffont); sfnt_close(sfont); - DPXFCLOSE(fp); + if (fp) + DPXFCLOSE(fp); if (verbose > 1) { MESG("[%u/%u glyphs][%ld bytes]", num_glyphs, cs_count, offset); |