shm: free scroll damage before returning cached buffer

This commit is contained in:
Daniel Eklöf 2021-05-09 00:06:01 +02:00
parent 9b339a35f0
commit 0433ba8477
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

2
shm.c
View file

@ -250,6 +250,8 @@ shm_get_buffer(struct wl_shm *shm, int width, int height, unsigned long cookie,
cookie, (void *)&it->item);
it->item.busy = true;
it->item.purge = false;
free(it->item.scroll_damage);
it->item.scroll_damage = NULL;
xassert(it->item.pix_instances == pix_instances);
cached = &it->item;
}