[cairo] [cairo-commit] src/cairo-xlib-surface.c

Behdad Esfahbod behdad at behdad.org
Sun Jan 9 16:56:20 PST 2011


On 01/08/11 05:54, Andrea Canciani wrote:

>  
> -	this_x = _cairo_lround (glyphs[i].d.x);
> -	this_y = _cairo_lround (glyphs[i].d.y);
> -
...
> -	if (((this_x+4096)|(this_y+4096))&~0x3fffu)
> +	if (glyphs[i].d.x > INT16_MAX || glyphs[i].d.y > INT16_MAX ||
> +	    glyphs[i].d.x < INT16_MIN || glyphs[i].d.y < INT16_MIN)
> +	{
>  	    break;
> +	}
> +
> +	this_x = _cairo_lround (glyphs[i].d.x);
> +	this_y = _cairo_lround (glyphs[i].d.y);

Any reason why not round then do the check?

Looks fine otherwise.

behdad


More information about the cairo mailing list