mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
fix crashes when resizing after CSD enabled at runtime with csd.size = 0
This commit is contained in:
parent
8e4d020a41
commit
304aacdb7a
2 changed files with 5 additions and 2 deletions
4
shm.c
4
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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue