summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@gmail.com>2012-08-06 11:54:48 +0200
committerSebastian Rasmussen <sebras@gmail.com>2012-08-06 14:06:50 +0200
commit8acf501687f3a406e8779871c306ba2ad76a440b (patch)
treede34d6b3b95be1c14eead7104865b6a300df3191
parent9406ed183d4f1b1bb2b44eee08dce751f0f15345 (diff)
downloadmupdf-8acf501687f3a406e8779871c306ba2ad76a440b.tar.xz
Check whether font in xps has charmap before using it
Thanks to Zeniko for pointing out this fix.
-rw-r--r--xps/xps_glyphs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/xps/xps_glyphs.c b/xps/xps_glyphs.c
index 6a7a1dcc..6b262016 100644
--- a/xps/xps_glyphs.c
+++ b/xps/xps_glyphs.c
@@ -46,7 +46,7 @@ xps_encode_font_char(fz_font *font, int code)
{
FT_Face face = font->ft_face;
int gid = FT_Get_Char_Index(face, code);
- if (gid == 0 && face->charmap->platform_id == 3 && face->charmap->encoding_id == 0)
+ if (gid == 0 && face->charmap && face->charmap->platform_id == 3 && face->charmap->encoding_id == 0)
gid = FT_Get_Char_Index(face, 0xF000 | code);
return gid;
}