[PATCH] dix: In MakeWindowOptional: Fix crash if parentOptional->cursor is NULL.

Kim Woelders kim at woelders.dk
Thu Sep 24 15:05:35 PDT 2009


Signed-off-by: Kim Woelders <kim at woelders.dk>
---
 dix/window.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/dix/window.c b/dix/window.c
index caff1cb..d4bc41c 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -3470,7 +3470,8 @@ MakeWindowOptional (WindowPtr pWin)
     if (!pWin->cursorIsNone)
     {
 	optional->cursor = parentOptional->cursor;
-	optional->cursor->refcnt++;
+	if (optional->cursor)
+	    optional->cursor->refcnt++;
     }
     else
     {
-- 
1.6.4.4



More information about the xorg-devel mailing list