diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2021-10-08 08:05:52 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2021-10-08 08:05:52 +0000 |
| commit | 0be711497d9982469f0f2d7497d84a59ae95f16f (patch) | |
| tree | ea634b8a42aa81bdc4f87f62b2658b9baf00ec03 | |
| parent | Merge branch 'notify-focus-inhibit' (diff) | |
| parent | changelog: mention csd.size=0 fix (diff) | |
Merge branch 'fix-0px-csd-crash'
| -rw-r--r-- | CHANGELOG.md | 1 | ||||
| -rw-r--r-- | render.c | 3 | ||||
| -rw-r--r-- | shm.c | 4 |
3 files changed, 6 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 27f92355..a9b57ff0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,7 @@ * ‘Sticky’ modifiers in input handling; when determining modifier state, foot was looking at **depressed** modifiers, not **effective** modifiers, like it should. +* Fix crashes after enabling CSD at runtime when `csd.size` is 0. ### Security @@ -1673,7 +1673,8 @@ render_csd_title(struct terminal *term, const struct csd_data *info, xassert(term->window->csd_mode == CSD_YES); struct wl_surf_subsurf *surf = &term->window->csd.surface[CSD_SURF_TITLE]; - xassert(info->width > 0 && info->height > 0); + if (info->width == 0 || info->height == 0) + return; xassert(info->width % term->scale == 0); xassert(info->height % term->scale == 0); @@ -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); |
