All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michel Dänzer" <michel-otUistvHUpPR7s880joybQ@public.gmane.org>
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: [PATCH xf86-video-ati 2/2] glamor: Bail CreatePixmap on unsupported pixmap depth
Date: Fri, 18 May 2018 16:21:40 +0200	[thread overview]
Message-ID: <20180518142140.20582-2-michel@daenzer.net> (raw)
In-Reply-To: <20180518142140.20582-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>

From: Michel Dänzer <michel.daenzer@amd.com>

Fixes crash in that case.

Bugzilla: https://bugs.freedesktop.org/106293
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
---
 src/radeon_glamor.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/radeon_glamor.c b/src/radeon_glamor.c
index 7c09abba5..10d513ea9 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)
-- 
2.17.0

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2018-05-18 14:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-18 14:21 [PATCH xf86-video-ati 1/2] Bail from dri2_create_buffer2 if we can't get a pixmap Michel Dänzer
     [not found] ` <20180518142140.20582-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-05-18 14:21   ` Michel Dänzer [this message]
     [not found]     ` <20180518142140.20582-2-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-05-21 19:02       ` [PATCH xf86-video-ati 2/2] glamor: Bail CreatePixmap on unsupported pixmap depth Alex Deucher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180518142140.20582-2-michel@daenzer.net \
    --to=michel-otuistvhuppr7s880joybq@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.