summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2018-07-10 18:11:04 +0200
committerMichel Dänzer <michel@daenzer.net>2018-07-11 18:27:50 +0200
commitace6ea016ce0013a34e1d4637aeacbf4d0e83c79 (patch)
treeced3f8635777f67d27d0f1bae952fcda6454fca1 /src
parentc160302abcdb18eec35c377d80e34f5bd857df45 (diff)
glamor: Bail CreatePixmap on unsupported pixmap depth
Fixes crash in that case. Bugzilla: https://bugs.freedesktop.org/106293 (Ported from radeon commit 65c9dfea4e841b7d6f795c7489fede58c5e9631f) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src')
-rw-r--r--src/amdgpu_glamor.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/amdgpu_glamor.c b/src/amdgpu_glamor.c
index 44cdbcf..8b83910 100644
--- a/src/amdgpu_glamor.c
+++ b/src/amdgpu_glamor.c
@@ -185,6 +185,9 @@ amdgpu_glamor_create_pixmap(ScreenPtr screen, int w, int h, int depth,
struct amdgpu_pixmap *priv;
PixmapPtr pixmap, new_pixmap = NULL;
+ if (!xf86GetPixFormat(scrn, depth))
+ return NULL;
+
if (!AMDGPU_CREATE_PIXMAP_SHARED(usage)) {
if (info->shadow_primary) {
if (usage != CREATE_PIXMAP_USAGE_BACKING_PIXMAP)