[vlc-devel] [PATCH 1/2] freetype: fix error handling in getPathForFontDescription

Marvin Scholz epirat07 at gmail.com
Thu Nov 7 10:19:48 CET 2019



On 7 Nov 2019, at 7:38, Steve Lhomme wrote:

> both patches LGTM
>
> You could also remove the getPathForFontDescription() and 
> addNewFontToFamily() declarations at the top of the file which are 
> useless.
>

Oh indeed, thanks! Will submit another patch for that.

> On 2019-11-07 0:43, Marvin Scholz wrote:
>> ---
>>   modules/text_renderer/freetype/fonts/darwin.c | 6 ++++++
>>   1 file changed, 6 insertions(+)
>>
>> diff --git a/modules/text_renderer/freetype/fonts/darwin.c 
>> b/modules/text_renderer/freetype/fonts/darwin.c
>> index cf7a90c94a..3b91284272 100644
>> --- a/modules/text_renderer/freetype/fonts/darwin.c
>> +++ b/modules/text_renderer/freetype/fonts/darwin.c
>> @@ -46,7 +46,13 @@ void addNewFontToFamily(filter_t *p_filter, 
>> CTFontDescriptorRef iter, char *path
>>   char* getPathForFontDescription(CTFontDescriptorRef fontDescriptor)
>>   {
>>       CFURLRef url = CTFontDescriptorCopyAttribute(fontDescriptor, 
>> kCTFontURLAttribute);
>> +    if (url == NULL)
>> +        return NULL;
>>       CFStringRef path = CFURLCopyFileSystemPath(url, 
>> kCFURLPOSIXPathStyle);
>> +    if (path == NULL) {
>> +        CFRelease(url);
>> +        return NULL;
>> +    }
>>       char *retPath = FromCFString(path, kCFStringEncodingUTF8);
>>       CFRelease(path);
>>       CFRelease(url);
>> -- 
>> 2.20.1 (Apple Git-117)
>>
>> _______________________________________________
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
>> https://mailman.videolan.org/listinfo/vlc-devel
>>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list