[cairo] fixed_from_double speedup masking pixman traps problem

Vladimir Vukicevic vladimir at pobox.com
Tue Nov 21 11:23:54 PST 2006


Daniel Amelang wrote:
> On 11/21/06, Bogdan Nicula <bogdanni at hotmail.com> wrote:
>> May be it still is preferable to stop on overflow here rather than
>> continuing with "bogus values", potentially corrupting memory. Remember,
>> cairo is critical infrastructure.
> 
> I think we all agree on this. The question (in my mind) is whether the
> error checking should go inside the function or not. Since there are
> only a few cases where the overflow could result in corrupted memory,
> I vote that we check for overflow in those places, not in the general
> function.

I agree; there's no need to use a sledgehammer, especially when it won't 
completely fix the problem -- arithmetic operations with the resulting 
(non-overflowing) fixed point numbers could cause overflow later.

I think we should leave detecting overflow as a problem to solve later 
(or even never); the first fix should be to the code in pixman that 
scribbles memory when given random trap coordinate numbers.  The worst 
overflow should give is bad rendering.

     - Vlad



More information about the cairo mailing list