aboutsummaryrefslogtreecommitdiff
path: root/shm.c
diff options
context:
space:
mode:
authorfeeptr <feeptr@codeberg.org>2021-09-23 22:17:43 +0000
committerfeeptr@codeberg.org <feeptr>2021-10-04 22:14:58 +0000
commit304aacdb7a1dfbe92e4b0e1a419a872bd3ba6113 (patch)
tree1dc99c8886755ad0010185d8022f5ab7c70fa9e7 /shm.c
parentinput: check for ‘effective’ modifiers, not ‘depressed’ (diff)
fix crashes when resizing after CSD enabled at runtime with csd.size = 0
Diffstat (limited to 'shm.c')
-rw-r--r--shm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/shm.c b/shm.c
index 60e45d4d..9db7e745 100644
--- a/shm.c
+++ b/shm.c
@@ -322,6 +322,8 @@ get_new_buffers(struct buffer_chain *chain, size_t count,
sizes[i] = stride[i] * heights[i];
total_size += sizes[i];
}
+ if (total_size == 0)
+ return;
int pool_fd = -1;
@@ -486,7 +488,7 @@ get_new_buffers(struct buffer_chain *chain, size_t count,
}
#endif
- if (!shm_can_scroll(bufs[0])) {
+ if (!(bufs[0] && shm_can_scroll(bufs[0]))) {
/* We only need to keep the pool FD open if we’re going to SHM
* scroll it */
close(pool_fd);