freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Check return of function


From: Kleber Tarcísio
Subject: Re: Check return of function
Date: Fri, 21 Aug 2020 07:13:00 +0000 (UTC)

Thanks for the feedback.

Kleber

Em sexta-feira, 21 de agosto de 2020 01:22:36 BRT, Werner LEMBERG <wl@gnu.org> escreveu:



>> Today the code is like this:
>>
>>    error = FT_New_Size( t42face->ttf_face, &ttsize );
>>    t42size->ttsize = ttsize;
>>    FT_Activate_Size( ttsize );
>>
>>  My initial suggestion was:
>>
>>    error = FT_New_Size( t42face->ttf_face, &ttsize );
>>    if(error)
>>        return error;
>>    t42size->ttsize = ttsize;
>>    FT_Activate_Size( ttsize );
>>
>> However, I observed that if ttsize is NULL, FT_Activate_Size
>> function will throw an exception.  Great In this case, what do you
>> think about this another change?
>>
>>    error = FT_New_Size( t42face->ttf_face, &ttsize );
>>    if(!error)
>>        t42size->ttsize = ttsize;
>>    FT_Activate_Size( ttsize );


I agree with Alexei that the change you suggest is not necessary.
Maybe I'm wrong, however: do you have a font that exhibits a problem
with the original code?

Note that FreeType gets tested continuously with a fuzzer, and there
wasn't any report to the code in question.


    Werner


reply via email to

[Prev in Thread] Current Thread [Next in Thread]