commit e1ac9c0e7a6167f14cb7899e585eeae74bb5d55d Author: Michel Dänzer Date: Thu Sep 27 13:08:41 2007 +0200 EXA: Make sure tile offsets passed to drivers are never negative. Thanks to Björn Steinbrink for pointing out the problem on IRC. diff --git a/exa/exa_accel.c b/exa/exa_accel.c index cc383cc..d19e3f4 100644 --- a/exa/exa_accel.c +++ b/exa/exa_accel.c @@ -1187,7 +1187,8 @@ exaFillRegionTiled (DrawablePtr pDrawable, int dstY = pBox->y1; int tileY; - tileY = (dstY - pDrawable->y - pPatOrg->y) % tileHeight; + modulus(dstY - pDrawable->y - pPatOrg->y, tileHeight, tileY); + while (height > 0) { int width = pBox->x2 - pBox->x1; int dstX = pBox->x1; @@ -1198,7 +1199,8 @@ exaFillRegionTiled (DrawablePtr pDrawable, h = height; height -= h; - tileX = (dstX - pDrawable->x - pPatOrg->x) % tileWidth; + modulus(dstX - pDrawable->x - pPatOrg->x, tileWidth, tileX); + while (width > 0) { int w = tileWidth - tileX; if (w > width)