From 75a0e067bd51a93441eda2d55e0ef16d7ad919a1 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Tue, 17 Aug 2010 15:13:32 -0400 Subject: [PATCH] fb: Fix overflow computation in lines/arcs/polys/glyphs (#11503) We can overflow 15-bit coordinates once we account for drawable offset, so, let's not do that. Signed-off-by: Adam Jackson --- fb/fbbits.h | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/fb/fbbits.h b/fb/fbbits.h index 8bf1a02..9d78603 100644 --- a/fb/fbbits.h +++ b/fb/fbbits.h @@ -25,7 +25,9 @@ * underlying datatypes instead of masks */ -#define isClipped(c,ul,lr) ((((c) - (ul)) | ((lr) - (c))) & 0x80008000) +#define isClipped(c, ul, lr) \ + ((intToX(c) < intToX(ul)) || (intToX(c) > intToX(lr)) || \ + (intToY(c) < intToY(ul)) || (intToY(c) > intToY(lr))) #ifdef HAVE_DIX_CONFIG_H #include -- 1.7.2