[PATCH] XAA: Verify "pixmap" ops are really called on pixmaps before reading privates.

Jamey Sharp jamey at minilop.net
Sun Jul 4 08:44:40 PDT 2010


The pixmap ops certainly are used for pixmaps (if they aren't
offscreen), but they're also used for windows when this screen doesn't
have the VT semaphore. I assume that could lead to an privates assertion
failure in xserver 1.9.

Signed-off-by: Jamey Sharp <jamey at minilop.net>
---
I'd appreciate if somebody would test and confirm that xserver 1.9 does
indeed assert-fail in this case, and report whether this patch fixes it.

 hw/xfree86/xaa/xaawrap.h |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/hw/xfree86/xaa/xaawrap.h b/hw/xfree86/xaa/xaawrap.h
index 3f3c261..21a242a 100644
--- a/hw/xfree86/xaa/xaawrap.h
+++ b/hw/xfree86/xaa/xaawrap.h
@@ -45,17 +45,19 @@
 
 #define XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw)\
     XAAGCPtr pGCPriv = (XAAGCPtr)dixLookupPrivate(&(pGC)->devPrivates, XAAGetGCKey()); \
-    XAAPixmapPtr pixPriv = XAA_GET_PIXMAP_PRIVATE((PixmapPtr)(pDraw));\
+    XAAPixmapPtr pixPriv = pDraw->type == DRAWABLE_PIXMAP ? XAA_GET_PIXMAP_PRIVATE((PixmapPtr)(pDraw)) : 0;\
     GCFuncs *oldFuncs = pGC->funcs;\
     pGC->funcs = pGCPriv->wrapFuncs;\
     pGC->ops = pGCPriv->wrapOps; \
     SYNC_CHECK(pGC)
     
-#define XAA_PIXMAP_OP_EPILOGUE(pGC)\
+#define XAA_PIXMAP_OP_EPILOGUE(pGC) do {\
     pGCPriv->wrapOps = pGC->ops;\
     pGC->funcs = oldFuncs;\
     pGC->ops   = &XAAPixmapOps;\
-    pixPriv->flags |= DIRTY
+    if(pixPriv)\
+	pixPriv->flags |= DIRTY;\
+} while(0)
 
 #ifdef HAVE_XORG_CONFIG_H
 #include <xorg-config.h>
-- 
1.7.0



More information about the xorg-devel mailing list