diff options
author | Henry Stiles <henry.stiles@artifex.com> | 2019-03-06 15:30:14 -0700 |
---|---|---|
committer | Henry Stiles <henry.stiles@artifex.com> | 2019-03-06 19:19:57 -0700 |
commit | b731a0d961516bd42b510e1ae036cca109b0ccdb (patch) | |
tree | 7c94b6c500c94dc392045f4c3bd5ae3e8a0e8275 | |
parent | 314c6b9026efbcada4e48b11c9a173a5e91d779c (diff) | |
download | ghostpdl-b731a0d961516bd42b510e1ae036cca109b0ccdb.tar.gz |
Bug #700671 fix file mode.
The file mode was incorrectly specified to include 'b' with the
sfopen(), the stream code adds another 'b' because it is always
binary. This can cause a crash on Windows 10 (see bug #696101).
Further gp_file_rb should only be used with gp_fopen().
-rw-r--r-- | pcl/pl/plfont.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pcl/pl/plfont.c b/pcl/pl/plfont.c index 9fb50b290..f284466d0 100644 --- a/pcl/pl/plfont.c +++ b/pcl/pl/plfont.c @@ -488,7 +488,7 @@ pl_font_glyph_width_cache_node_add(pl_font_t *plfont, if (plfont->widths_cache_nitems > PL_MAX_WIDTHS_CACHE_NITEMS) { pl_font_glyph_width_cache_remove_nodes(plfont); } - + node = (pl_glyph_width_node_t *) gs_alloc_bytes(plfont->pfont->memory, sizeof (pl_glyph_width_node_t), @@ -559,7 +559,7 @@ pl_font_char_width(const pl_font_t * plfont, const void *pgs, if (pl_font_glyph_width_cache_node_search(plfont, char_code, pwidth) >= 0) { return(code); } - + if ((code = (*(plfont)->char_width) (plfont, pgs, char_code, pwidth)) == 0) { /* at least here, ignore the return value - if we fail to add a node @@ -1167,7 +1167,7 @@ pl_load_resident_font_data_from_file(gs_memory_t * mem, pl_font_t * plfont) byte *data; if (plfont->font_file && !plfont->font_file_loaded) { - stream *in = sfopen(plfont->font_file, gp_fmode_rb, mem); + stream *in = sfopen(plfont->font_file, "r", mem); if (in == NULL) return -1; |