freetype-devel
[Top][All Lists]
Advanced

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

[ft-devel] those OVERFLOW_* macros and Fontval b69 (Re: Freetype-devel D


From: Hin-Tak Leung
Subject: [ft-devel] those OVERFLOW_* macros and Fontval b69 (Re: Freetype-devel Digest, Vol 149, Issue 5
Date: Sun, 4 Jun 2017 17:50:21 +0000 (UTC)

 
> Message: 3
> Date: Sun, 04 Jun 2017 06:53:39 +0200
 (CEST)
> From: Werner LEMBERG <address@hidden>

...
> . Recently, integer overflow run-time
 checking was activated (again)
   for the fuzzer, causing a lot of
 minor code changes while applying
   fixes. ...

I have been following those new OVERFLOW_* macros... they are a bit ugly and 
mostly purely for suppressing warnings?

But it does seem to offer a convenient way of implementing the last two error 
checkings which FontVal 1.0 does that FontVal 2.x does not no yet. The other 
one is "drawing in non-twilight while in prep". (does it trash every glyph or 
get ignored by freetype?).

e.g. for your OVERFLOW_ADD_LONG() , if I undef your version locally in the 
truetype module, but define a new one as:

#define OVERFLOW_ADD_LONG(a,b) func_check_add_long(exc, (FT_ULong)a,(FT_ULong)b)

FT_Long func_check_add_long(TT_ExecContext exc, FT_ULong a, FT_ULong b)
{
 //...
 /* Do some checking and if it overflows, calls the function pointer in exc */
 //...
  return a + b ; /* your version */
}


What do you think? In fact perhaps if those macros are defined as inline 
functions, that would make it even easier?


reply via email to

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