From 4b18b1ce4a28add6d791eb89d7ae00c53d4e6344 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Tue, 13 Oct 2009 12:54:56 -0700 Subject: [PATCH] Rootless: src drawable window can now be NULL Fix a possible crash when pSrc->pDrawable is NULL. Signed-off-by: Colin Harrison Signed-off-by: Jeremy Huddleston (cherry picked from commit 7e178ffbed7c8557faf8d471ad275aa2b0365e1d) --- miext/rootless/rootlessScreen.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/miext/rootless/rootlessScreen.c b/miext/rootless/rootlessScreen.c index 31b0d8b6b..8ac7e0d15 100644 --- a/miext/rootless/rootlessScreen.c +++ b/miext/rootless/rootlessScreen.c @@ -253,7 +253,7 @@ RootlessComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, maskWin = (pMask->pDrawable->type == DRAWABLE_WINDOW) ? (WindowPtr)pMask->pDrawable : NULL; } - srcWin = (pSrc->pDrawable->type == DRAWABLE_WINDOW) ? + srcWin = (pSrc->pDrawable && pSrc->pDrawable->type == DRAWABLE_WINDOW) ? (WindowPtr)pSrc->pDrawable : NULL; dstWin = (pDst->pDrawable->type == DRAWABLE_WINDOW) ? (WindowPtr)pDst->pDrawable : NULL; @@ -293,7 +293,7 @@ RootlessGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst, GlyphPtr glyph; WindowPtr srcWin, dstWin; - srcWin = (pSrc->pDrawable->type == DRAWABLE_WINDOW) ? + srcWin = (pSrc->pDrawable && pSrc->pDrawable->type == DRAWABLE_WINDOW) ? (WindowPtr)pSrc->pDrawable : NULL; dstWin = (pDst->pDrawable->type == DRAWABLE_WINDOW) ? (WindowPtr)pDst->pDrawable : NULL;