mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-08 10:06:22 -05:00
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.
This commit is contained in:
parent
9829539af8
commit
792b443918
1 changed files with 1 additions and 1 deletions
2
render.c
2
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 */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue