summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2018-05-23 11:18:02 +0200
committerMichel Dänzer <michel@daenzer.net>2018-05-28 17:08:34 +0200
commit4d5950ce14676f970d9de97380929a93948b98f2 (patch)
tree3e652a8e9946f08b3150cfe14d9247466526cdf3
parent3da999a0390407d512bf784e4faf01482bfff9ea (diff)
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 <emil.l.velikov@gmail.com>
-rw-r--r--glamor/glamor.c2
1 files changed, 1 insertions, 1 deletions
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;