mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-09-04 00:46:17 +00:00
Fix alpha mask leak when growing the font canvas
This commit is contained in:
parent
b3273b5f8c
commit
1423c33fb8
1 changed files with 1 additions and 0 deletions
|
|
@ -193,6 +193,7 @@ ensure_canvas_can_fit(FontGroup *fg, unsigned cells, unsigned scale) {
|
|||
#undef cs
|
||||
size_in_bytes = (sizeof(fg->canvas.alpha_mask[0]) * SUPERSAMPLE_FACTOR * SUPERSAMPLE_FACTOR * 2 * fg->fcm.cell_width * fg->fcm.cell_height * scale * scale);
|
||||
if (size_in_bytes > fg->canvas.alpha_mask_sz_in_bytes) {
|
||||
free(fg->canvas.alpha_mask);
|
||||
fg->canvas.alpha_mask_sz_in_bytes = size_in_bytes;
|
||||
fg->canvas.alpha_mask = malloc(fg->canvas.alpha_mask_sz_in_bytes);
|
||||
if (!fg->canvas.alpha_mask) fatal("Out of memory allocating canvas");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue