From 246e4aeaef4c1f1071c64e9681fc9229aac22020 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 24 Feb 2020 10:19:51 +1000 Subject: [PATCH] glx/drisw: return false if shmid == -1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit If an attempt to create an shm pixmap in XCreateDrawable fails then it ends up with the shmid == -1. This means the get image path needs to fallback so return false in this case to use the non-shm get image path. Fixes: 02c3dad0f3b4 ("Call shmget() with permission 0600 instead of 0777") Reviewed-by: Michel Dänzer Part-of: --- src/glx/drisw_glx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c index 6e37f0274b0..dfa3218d759 100644 --- a/src/glx/drisw_glx.c +++ b/src/glx/drisw_glx.c @@ -303,6 +303,9 @@ swrastGetImageShm2(__DRIdrawable * read, if (!XCreateDrawable(prp, shmid, dpy)) return GL_FALSE; } + + if (prp->shminfo.shmid == -1) + return GL_FALSE; readable = pread->xDrawable; ximage = prp->ximage; -- 2.30.2