aboutsummaryrefslogtreecommitdiff
path: root/render.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-01-03 11:05:48 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-01-03 11:05:48 +0000
commit792b4439185808f90d25bf70ebc91deb4f30c003 (patch)
tree128bd5a0d6cb6c5e1385c2586c5a0abaaa33b8d4 /render.c
parentfcft: ignore `embeddedbitmap` for non-scalable fonts (diff)
render: use a unique buffer cookie for the 'search' surface
This fixes an issue where rendering the 'search' box caused the last normal buffer from being purged. This meant the terminal had a pointer to a now freed buffer, which we de-referenced and occasionally memcpy:ied from.
Diffstat (limited to 'render.c')
-rw-r--r--render.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/render.c b/render.c
index 97284cbb..137e98b4 100644
--- a/render.c
+++ b/render.c
@@ -886,7 +886,7 @@ render_search_box(struct terminal *term)
const int width = min(term->width, 2 * margin + max(20, term->search.len) * term->cell_width);
const int height = min(term->height, 2 * margin + 1 * term->cell_height);
- unsigned long cookie = (uintptr_t)term;
+ unsigned long cookie = (uintptr_t)term + 1;
struct buffer *buf = shm_get_buffer(term->wl->shm, width, height, cookie);
/* Background - yellow on empty/match, red on mismatch */