From df534d05208436e9ca8c9b42acff3fbe240e3ec4 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 5 Jun 2010 21:24:54 -0700 Subject: Make GetPictureScreenIfSet check if Render is running This macro originally checked to see if the Render screen private index had been allocated. When the privates were changed the first time, there wasn't any need to check as dixLookupPrivate would simply return NULL in that case. Now that we care, check to see if the key has been initialized before asking for the value. Reviewed-by: Jamey Sharp Signed-off-by: Keith Packard --- render/picturestr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'render') diff --git a/render/picturestr.h b/render/picturestr.h index da69ff601..5c6c41e23 100644 --- a/render/picturestr.h +++ b/render/picturestr.h @@ -407,7 +407,7 @@ extern _X_EXPORT RESTYPE PictFormatType; extern _X_EXPORT RESTYPE GlyphSetType; #define GetPictureScreen(s) ((PictureScreenPtr)dixLookupPrivate(&(s)->devPrivates, PictureScreenPrivateKey)) -#define GetPictureScreenIfSet(s) GetPictureScreen(s) +#define GetPictureScreenIfSet(s) (dixPrivateKeyRegistered(PictureScreenPrivateKey) ? GetPictureScreen(s) : NULL) #define SetPictureScreen(s,p) dixSetPrivate(&(s)->devPrivates, PictureScreenPrivateKey, p) #define GetPictureWindow(w) ((PicturePtr)dixLookupPrivate(&(w)->devPrivates, PictureWindowPrivateKey)) #define SetPictureWindow(w,p) dixSetPrivate(&(w)->devPrivates, PictureWindowPrivateKey, p) -- cgit v1.2.3