Commit 10e87394 authored by Felix Paul Kühne's avatar Felix Paul Kühne
Browse files

freetype: provide a proper fix to prevent ATS from crashing when searching for...

freetype: provide a proper fix to prevent ATS from crashing when searching for the font family instead of the fontname
parent 9240f975
......@@ -726,9 +726,8 @@ static char* MacLegacy_Select( filter_t *p_filter, const char* psz_fontname,
cf_fontName = CFStringCreateWithCString( kCFAllocatorDefault, psz_fontname, kCFStringEncodingUTF8 );
ats_font_id = ATSFontFindFromName( cf_fontName, kATSOptionFlagsIncludeDisabledMask );
CFRelease( cf_fontName );
if ( ats_font_id == 0xFFFFFFFFUL )
if ( ats_font_id == 0 || 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, kATSOptionFlagsDefault );
......@@ -736,14 +735,11 @@ static char* MacLegacy_Select( filter_t *p_filter, const char* psz_fontname,
if ( ats_font_id == 0 || ats_font_id == 0xFFFFFFFFUL )
{
msg_Err( p_filter, "ATS couldn't find either %s nor its family", psz_fontname );
CFRelease( cf_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;
}
CFRelease( cf_fontName );
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