From 65c9dfea4e841b7d6f795c7489fede58c5e9631f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Tue, 15 May 2018 18:59:30 +0200 Subject: glamor: Bail CreatePixmap on unsupported pixmap depth Fixes crash in that case. Bugzilla: https://bugs.freedesktop.org/106293 Reviewed-by: Alex Deucher --- src/radeon_glamor.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/radeon_glamor.c') 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) -- cgit v1.2.3