freetype-devel
[Top][All Lists]
Advanced

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

Re: [ft-devel] state of the diagnostics patch b68+6.5, last two error co


From: Hin-Tak Leung
Subject: Re: [ft-devel] state of the diagnostics patch b68+6.5, last two error codes, and undocumented engine behaviors
Date: Mon, 7 Nov 2016 06:52:47 +0000 (UTC)

--------------------------------------------
On Mon, 7/11/16, Werner LEMBERG <address@hidden> wrote:

> >
 FreeType does not seem to check 16-bit overflows on
 ADD/SUB/MUL/DIV,
 
> 16bit
 overflows?  What are you talking about?  All those
 arithmetic
 operations use 32bit integers, in
 26.6 format.
 
> You are right
 that FreeType doesn't check them, since it is not
 necessary for normal operation.
 

Argh, you are right about the F26.6 part. I got confused with F16.16 & F2.14 
etc. Too many of those...


> > I am unlikely to spend
 time adding that, but if somebody else adds
 > the check to FreeType, I'll hook it
 up...
 
> Hmm, this is
 unlikely, since such tests are specific to a font
 validator (which FreeType is not).
 

Yes, so I reckon. If a font has such problem, it would be visibly broken 
anyway; more a job for sanitizer (screening for bad fonts) than validator 
(making usable ones better...). If the calculation is used for the projection 
vector or freedom vector, it would show up on the checks on those also.


> > E6040 is an interesting
 one - it is about using real (non-twilight)
 > zones in pre-programs.  [...]
 > 
 > Werner: what does
 FreeType do exactly, in this case?
 
> Nothing in normal mode, setting an error if
 pedantic hinting is on,
 since it checks
 whether the requested point index is smaller than the
 number of available points – and we don't
 have any outline points in
 the
 pre-programs.
 

Good to know. In that case, there's to implement - I already hooked up all the 
bound checks in b54. It would be nice to have a more specific error message 
with E6040 "Zone referenced in pre-program is not the twilight zone" , but a 
E6039 "Point out of range" will happen in that case, and is sufficient. The 
detail part of the message will say what offsets in the pre-program.

When I was looking at the code, I was not sure whether "Point out of range" 
would happen. Good to clear that up. Thanks.



reply via email to

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