From 006f6525057970a74382132237b2131286ad147c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Thu, 27 Sep 2007 13:08:41 +0200 Subject: [PATCH] EXA: Make sure tile offsets passed to drivers are never negative. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thanks to Björn Steinbrink for pointing out the problem on IRC. --- exa/exa_accel.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/exa/exa_accel.c b/exa/exa_accel.c index 142d556a0..908953589 100644 --- a/exa/exa_accel.c +++ b/exa/exa_accel.c @@ -1239,7 +1239,8 @@ exaFillRegionTiled (DrawablePtr pDrawable, int dstY = pBox->y1; int tileY; - tileY = (dstY - yoff - pDrawable->y - pPatOrg->y) % tileHeight; + modulus(dstY - yoff - pDrawable->y - pPatOrg->y, tileHeight, tileY); + while (height > 0) { int width = pBox->x2 - pBox->x1; int dstX = pBox->x1; @@ -1250,7 +1251,9 @@ exaFillRegionTiled (DrawablePtr pDrawable, h = height; height -= h; - tileX = (dstX - xoff - pDrawable->x - pPatOrg->x) % tileWidth; + modulus(dstX - xoff - pDrawable->x - pPatOrg->x, tileWidth, + tileX); + while (width > 0) { int w = tileWidth - tileX; if (w > width)