diff options
-rw-r--r-- | Build/source/texk/dvipdfm-x/ChangeLog | 7 | ||||
-rw-r--r-- | Build/source/texk/dvipdfm-x/dvi.c | 5 |
2 files changed, 12 insertions, 0 deletions
diff --git a/Build/source/texk/dvipdfm-x/ChangeLog b/Build/source/texk/dvipdfm-x/ChangeLog index c5c89d2da49..035c985057e 100644 --- a/Build/source/texk/dvipdfm-x/ChangeLog +++ b/Build/source/texk/dvipdfm-x/ChangeLog @@ -1,3 +1,10 @@ +2015-02-21 Khaled Hosny <khaledhosny@eglug.org> + + * dvi.c (dvi_locate_font, dvi_locate_native_font): make sure the + all members of loaded font struct are initialized, avoid crash in + dvi_close for simple fonts because hvmt member is not initialized. + Fixes the xdvipdfmx-bkm test. + 2015-02-21 Akira Kakuto <kakuto@fuk.kindai.ac.jp> * dvi.c: Read glyph advances without the need for FreeType, based on diff --git a/Build/source/texk/dvipdfm-x/dvi.c b/Build/source/texk/dvipdfm-x/dvi.c index 47b66c70c8d..2d201afce27 100644 --- a/Build/source/texk/dvipdfm-x/dvi.c +++ b/Build/source/texk/dvipdfm-x/dvi.c @@ -797,6 +797,8 @@ dvi_locate_font (const char *tfm_name, spt_t ptsize) subfont_id = sfd_load_record(mrec->charmap.sfd_name, mrec->charmap.subfont_id); } + memset(&loaded_fonts[cur_id], 0, sizeof (struct loaded_font)); + /* TFM must exist here. */ loaded_fonts[cur_id].tfm_id = tfm_open(tfm_name, 1); loaded_fonts[cur_id].subfont_id = subfont_id; @@ -941,6 +943,9 @@ dvi_locate_native_font (const char *filename, uint32_t index, /* FIXME: would be more efficient if pdf_load_native_font returned the mrec ptr (or NULL for error) so we could avoid doing a second lookup for the item we just inserted */ } + + memset(&loaded_fonts[cur_id], 0, sizeof (struct loaded_font)); + loaded_fonts[cur_id].font_id = pdf_dev_locate_font(fontmap_key, ptsize); loaded_fonts[cur_id].size = ptsize; loaded_fonts[cur_id].type = NATIVE; |