Merge branch 'fix/font-alpha-mask-leak' of https://github.com/M-Hassan-Raza/kitty
Some checks are pending
CI / Linux (python=3.14 cc=clang sanitize=1) (push) Waiting to run
CI / Linux (python=3.12 cc=gcc sanitize=0) (push) Waiting to run
CI / Linux (python=3.13 cc=gcc sanitize=1) (push) Waiting to run
CI / Linux package (push) Waiting to run
CI / Bundle test (macos-latest) (push) Waiting to run
CI / Bundle test (ubuntu-latest) (push) Waiting to run
CI / macOS Brew (push) Waiting to run
CI / Test ./dev.sh and benchmark (push) Waiting to run
CodeQL / CodeQL-Build (actions, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, macos-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (go, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (python, ubuntu-latest) (push) Waiting to run
Depscan / Scan dependencies for vulnerabilities (push) Waiting to run

This commit is contained in:
Kovid Goyal 2026-08-28 15:58:08 +05:30
commit 412b856771
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

@ -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");