From 33f20c38fc15e6664635ad22a581d7860e4b185d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Wed, 23 May 2018 11:18:02 +0200 Subject: [PATCH] glamor: Propagate glamor_fds_from_pixmap error in glamor_fd_from_pixmap glamor_fds_from_pixmap returns 0 on error, but we were treating that as success, continuing with uninitialized stride and fd values. Also bail if the offset isn't 0, same as in dri3_fd_from_pixmap. v2: * Reduce to a simple one-liner fix (Emil Velikov) Fixes: c8c276c9569b "glamor: Implement PixmapFromBuffers and BuffersFromPixmap" Reviewed-by: Emil Velikov (cherry picked from commit 4d5950ce14676f970d9de97380929a93948b98f2) --- glamor/glamor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glamor/glamor.c b/glamor/glamor.c index e2c74d17a..54ca0db35 100644 --- a/glamor/glamor.c +++ b/glamor/glamor.c @@ -865,7 +865,7 @@ glamor_fd_from_pixmap(ScreenPtr screen, &modifier); /* Pixmaps with multi-planes/modifier are not supported in this interface */ - if (ret > 1) { + if (ret != 1 || offsets[0] != 0) { while (ret > 0) close(fds[--ret]); return -1;