Commit d96f6e23 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

FreeType: fix NULL deref on embedded fonts (fixes #7771)

FT_Face.family_name can be NULL for embedded fonts.

See also http://www.freetype.org/freetype2/docs/reference/ft2-base_interface.html#FT_FaceRec
parent 024ca98d
......@@ -1788,8 +1788,10 @@ static FT_Face LoadEmbeddedFace( filter_sys_t *p_sys, const text_style_t *p_styl
{
int i_style_received = ((p_face->style_flags & FT_STYLE_FLAG_BOLD) ? STYLE_BOLD : 0) |
((p_face->style_flags & FT_STYLE_FLAG_ITALIC ) ? STYLE_ITALIC : 0);
if( !strcasecmp( p_face->family_name, p_style->psz_fontname ) &&
(p_style->i_style_flags & (STYLE_BOLD | STYLE_ITALIC)) == i_style_received )
if( p_face->family_name != NULL
&& !strcasecmp( p_face->family_name, p_style->psz_fontname )
&& (p_style->i_style_flags & (STYLE_BOLD | STYLE_ITALIC))
== i_style_received )
return p_face;
FT_Done_Face( p_face );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment