summaryrefslogtreecommitdiff
path: root/render/picture.c
diff options
context:
space:
mode:
Diffstat (limited to 'render/picture.c')
-rw-r--r--render/picture.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/render/picture.c b/render/picture.c
index 45498b093..1126eb97e 100644
--- a/render/picture.c
+++ b/render/picture.c
@@ -22,9 +22,10 @@
* Author: Keith Packard, SuSE, Inc.
*/
-#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
-#endif
+
+#include "dix/colormap_priv.h"
+#include "os/osdep.h"
#include "misc.h"
#include "scrnintstr.h"
@@ -42,9 +43,9 @@
#include "picturestr_priv.h"
#include "glyphstr_priv.h"
#include "xace.h"
-#ifdef PANORAMIX
+#ifdef XINERAMA
#include "panoramiXsrv.h"
-#endif
+#endif /* XINERAMA */
DevPrivateKeyRec PictureScreenPrivateKeyRec;
DevPrivateKeyRec PictureWindowPrivateKeyRec;
@@ -428,6 +429,9 @@ PictureInitIndexedFormat(ScreenPtr pScreen, PictFormatPtr format)
else {
VisualPtr pVisual = PictureFindVisual(pScreen, format->index.vid);
+ if (pVisual == NULL)
+ return FALSE;
+
if (CreateColormap(FakeClientID(0), pScreen, pVisual,
&format->index.pColormap, AllocNone, 0)
!= Success)
@@ -760,7 +764,7 @@ CreatePicture(Picture pid,
pPicture->format = pFormat->format | (pDrawable->bitsPerPixel << 24);
/* security creation/labeling check */
- *error = XaceHook(XACE_RESOURCE_ACCESS, client, pid, PictureType, pPicture,
+ *error = XaceHookResourceAccess(client, pid, PictureType, pPicture,
X11_RESTYPE_PIXMAP, pDrawable, DixCreateAccess | DixSetAttrAccess);
if (*error != Success)
goto out;
@@ -1002,7 +1006,7 @@ CreateConicalGradientPicture(Picture pid, xPointFixed * center, xFixed angle,
static int
cpAlphaMap(void **result, XID id, ScreenPtr screen, ClientPtr client, Mask mode)
{
-#ifdef PANORAMIX
+#ifdef XINERAMA
if (!noPanoramiXExtension) {
PanoramiXRes *res;
int err = dixLookupResourceByType((void **)&res, id, XRT_PICTURE,
@@ -1011,14 +1015,14 @@ cpAlphaMap(void **result, XID id, ScreenPtr screen, ClientPtr client, Mask mode)
return err;
id = res->info[screen->myNum].id;
}
-#endif
+#endif /* XINERAMA */
return dixLookupResourceByType(result, id, PictureType, client, mode);
}
static int
cpClipMask(void **result, XID id, ScreenPtr screen, ClientPtr client, Mask mode)
{
-#ifdef PANORAMIX
+#ifdef XINERAMA
if (!noPanoramiXExtension) {
PanoramiXRes *res;
int err = dixLookupResourceByType((void **)&res, id, XRT_PIXMAP,
@@ -1027,7 +1031,7 @@ cpClipMask(void **result, XID id, ScreenPtr screen, ClientPtr client, Mask mode)
return err;
id = res->info[screen->myNum].id;
}
-#endif
+#endif /* XINERAMA */
return dixLookupResourceByType(result, id, X11_RESTYPE_PIXMAP, client, mode);
}