Commit 6938a98a authored by Felix Paul Kühne's avatar Felix Paul Kühne

freetype: fixed crash within ATS when looking for non-existing font families

parent f8aa3950
......@@ -722,14 +722,15 @@ static char* MacLegacy_Select( filter_t *p_filter, const char* psz_fontname,
*i_idx = 0;
msg_Dbg( p_filter, "looking for %s", psz_fontname );
cf_fontName = CFStringCreateWithCString( NULL, psz_fontname, kCFStringEncodingUTF8 );
cf_fontName = CFStringCreateWithCString( kCFAllocatorDefault, psz_fontname, kCFStringEncodingUTF8 );
ats_font_id = ATSFontFindFromName( cf_fontName, kATSOptionFlagsIncludeDisabledMask );
CFRelease( cf_fontName );
if ( ats_font_id == 0 || ats_font_id == 0xFFFFFFFFUL )
if ( ats_font_id == 0xFFFFFFFFUL )
{
msg_Dbg( p_filter, "ATS couldn't find %s by name, checking family", psz_fontname );
ats_font_id = ATSFontFamilyFindFromName( cf_fontName, kATSOptionFlagsIncludeDisabledMask );
ats_font_id = ATSFontFamilyFindFromName( cf_fontName, kATSOptionFlagsDefault );
if ( ats_font_id == 0 || ats_font_id == 0xFFFFFFFFUL )
{
......@@ -737,6 +738,11 @@ static char* MacLegacy_Select( filter_t *p_filter, const char* psz_fontname,
return NULL;
}
}
else if( ats_font_id == 0 )
{
msg_Err( p_filter, "ATS couldn't find %s by name, won't check family", psz_fontname );
return NULL;
}
if ( noErr != ATSFontGetFileReference( ats_font_id, &ref ) )
{
......
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