From b731a0d961516bd42b510e1ae036cca109b0ccdb Mon Sep 17 00:00:00 2001 From: Henry Stiles Date: Wed, 6 Mar 2019 15:30:14 -0700 Subject: 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(). --- pcl/pl/plfont.c | 6 +++--- 1 file 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; -- cgit v1.2.1