Hello,
When FT_New_Face() is called for an otf font with face_index == -1
freetype segfaults.
The backtrace looks like this:
#0 0xb557a46c in cff_slot_init (slot=0x8057070) at cffobjs.c:304
#1 0xb55601f8 in ft_glyphslot_init (slot=0x8057070) at ftobjs.c:225
#2 0xb5560550 in FT_New_GlyphSlot (face=0x8056ca0, aslot=0xbfffdda8) at
ftobjs.c:362
#3 0xb5561f84 in FT_Open_Face (library=0x8050b18, args=0xbfffde00,
face_index=-1, aface=0xbfffde4c) at ftobjs.c:1685
#4 0xb5561039 in FT_New_Face (library=0x8050b18, pathname=0xbffff34b
And it segfaults here:
FT_LOCAL_DEF( FT_Error )
cff_slot_init( FT_GlyphSlot slot )
{
CFF_Face face = (CFF_Face)slot->face;
CFF_Font font = (CFF_FontRec *)face->extra.data;
-> PSHinter_Service pshinter = (PSHinter_Service)font->pshinter;
The problem is that with face_index == -1 cff_face_init() returns before
face->extra.data and cff->pshinter are set.
No patch since I'm not sure what the proper fix would be...