summaryrefslogtreecommitdiff
path: root/src/radeon_glamor.c
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2018-05-15 18:59:30 +0200
committerMichel Dänzer <michel@daenzer.net>2018-05-22 18:30:48 +0200
commit65c9dfea4e841b7d6f795c7489fede58c5e9631f (patch)
tree8091d94e82852e9cc3c42d6326ca52da6e1793e2 /src/radeon_glamor.c
parent3dcfce8d0f495d09d7836caf98ef30d625b78a13 (diff)
glamor: Bail CreatePixmap on unsupported pixmap depth
Fixes crash in that case. Bugzilla: https://bugs.freedesktop.org/106293 Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src/radeon_glamor.c')
-rw-r--r--src/radeon_glamor.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/radeon_glamor.c b/src/radeon_glamor.c
index 7c09abba..10d513ea 100644
--- a/src/radeon_glamor.c
+++ b/src/radeon_glamor.c
@@ -214,6 +214,9 @@ radeon_glamor_create_pixmap(ScreenPtr screen, int w, int h, int depth,
struct radeon_pixmap *priv;
PixmapPtr pixmap, new_pixmap = NULL;
+ if (!xf86GetPixFormat(scrn, depth))
+ return NULL;
+
if (!RADEON_CREATE_PIXMAP_SHARED(usage)) {
if (info->shadow_primary) {
if (usage != CREATE_PIXMAP_USAGE_BACKING_PIXMAP)