From 9adea807038b64292403ede982075fe1dcfd4c9a Mon Sep 17 00:00:00 2001 From: Hong Liu Date: Tue, 4 Sep 2007 08:46:46 +0100 Subject: [PATCH 1/3] bgPixel (unsigned long) is 64-bit on x86_64, so -1 != 0xffffffff This patch should fix bug 8080. --- hw/xfree86/xaa/xaaGC.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hw/xfree86/xaa/xaaGC.c b/hw/xfree86/xaa/xaaGC.c index f3434c9f4..b3dc83ada 100644 --- a/hw/xfree86/xaa/xaaGC.c +++ b/hw/xfree86/xaa/xaaGC.c @@ -80,10 +80,11 @@ XAAValidateGC( } if(pGC->depth != 32) { - if(pGC->bgPixel == -1) /* -1 is reserved for transparency */ - pGC->bgPixel = 0x7fffffff; - if(pGC->fgPixel == -1) /* -1 is reserved for transparency */ - pGC->fgPixel = 0x7fffffff; + /* 0xffffffff is reserved for transparency */ + if(pGC->bgPixel == 0xffffffff) + pGC->bgPixel = 0x7fffffff; + if(pGC->fgPixel == 0xffffffff) + pGC->fgPixel = 0x7fffffff; } if((pDraw->type == DRAWABLE_PIXMAP) && !IS_OFFSCREEN_PIXMAP(pDraw)){ From 7c5de093d499de63d39fe038d86da0a085262017 Mon Sep 17 00:00:00 2001 From: Egbert Eich Date: Tue, 4 Sep 2007 15:07:17 +0200 Subject: [PATCH 2/3] Fixing sig11 in xf86I2CGetScreenBuses(). Dereferencing a pointer once too often caused a sig11 in xf86I2CGetScreenBuses(). --- hw/xfree86/i2c/xf86i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xfree86/i2c/xf86i2c.c b/hw/xfree86/i2c/xf86i2c.c index 53382a859..0139612f5 100644 --- a/hw/xfree86/i2c/xf86i2c.c +++ b/hw/xfree86/i2c/xf86i2c.c @@ -883,7 +883,7 @@ xf86I2CGetScreenBuses(int scrnIndex, I2CBusPtr **pppI2CBus) continue; *pppI2CBus = xnfrealloc(*pppI2CBus, n * sizeof(I2CBusPtr)); - *pppI2CBus[n - 1] = pI2CBus; + pppI2CBus[n - 1] = pI2CBus; } return n; From 735da3dcd09f59c40f68eca8c9a91c2e826cd1b9 Mon Sep 17 00:00:00 2001 From: Egbert Eich Date: Tue, 4 Sep 2007 16:42:57 +0200 Subject: [PATCH 3/3] Fixing xf86I2CGetScreenBuses(), now dereferencing the correct pointer. --- hw/xfree86/i2c/xf86i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xfree86/i2c/xf86i2c.c b/hw/xfree86/i2c/xf86i2c.c index 0139612f5..5cc83faa3 100644 --- a/hw/xfree86/i2c/xf86i2c.c +++ b/hw/xfree86/i2c/xf86i2c.c @@ -883,7 +883,7 @@ xf86I2CGetScreenBuses(int scrnIndex, I2CBusPtr **pppI2CBus) continue; *pppI2CBus = xnfrealloc(*pppI2CBus, n * sizeof(I2CBusPtr)); - pppI2CBus[n - 1] = pI2CBus; + (*pppI2CBus)[n - 1] = pI2CBus; } return n;