From 0693083335185ce05ee64546151f3fc43ce98575 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Mon, 6 Mar 2006 21:00:09 +0000 Subject: [PATCH] render/picture.c Correctly initialize devPrivates variable in source only pictures to 0 miext/cw/cw.h Don't try to access devPrivates of source only pictures --- ChangeLog | 8 ++++++++ miext/cw/cw.h | 3 ++- render/picture.c | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index fffc6408f..2c99ae9d8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-03-06 Lars Knoll + + * render/picture.c + Correctly initialize devPrivates variable in source + only pictures to 0 + * miext/cw/cw.h + Don't try to access devPrivates of source only pictures + 2006-03-04 Matthieu Herrb * hw/xfree86/dixmods/extmod/xf86misc.c Only output SetClientVersion message if verbosity > 1, like other diff --git a/miext/cw/cw.h b/miext/cw/cw.h index 167308eb6..09cfc7828 100644 --- a/miext/cw/cw.h +++ b/miext/cw/cw.h @@ -60,7 +60,8 @@ typedef struct { unsigned long stateChanges; } cwPictureRec, *cwPicturePtr; -#define getCwPicture(pPicture) ((cwPicturePtr)(pPicture)->devPrivates[cwPictureIndex].ptr) +#define getCwPicture(pPicture) \ + (pPicture->pDrawable ? (cwPicturePtr)(pPicture)->devPrivates[cwPictureIndex].ptr : 0) #define setCwPicture(pPicture,p) ((pPicture)->devPrivates[cwPictureIndex].ptr = (pointer) (p)) extern int cwPictureIndex; diff --git a/render/picture.c b/render/picture.c index 629f20bcc..299bded3f 100644 --- a/render/picture.c +++ b/render/picture.c @@ -979,6 +979,7 @@ static PicturePtr createSourcePicture(void) pPicture->pDrawable = 0; pPicture->pFormat = 0; pPicture->pNext = 0; + pPicture->devPrivates = 0; SetPictureToDefaults(pPicture); return pPicture;