Commit dee1ee38 authored by Felix Paul Kühne's avatar Felix Paul Kühne

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
(cherry picked from commit 10e87394ea679dd8bdabc582d4f83ca90f9e8c40)
parent 89bb8968
......@@ -725,9 +725,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 );
......@@ -735,14 +734,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