diff options
author | bptato <nincsnevem662@gmail.com> | 2024-06-29 15:45:45 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2024-06-29 15:46:53 +0200 |
commit | 420a716de6773c720b4d0af185294093825c037b (patch) | |
tree | 0b324a23be5f370378e148a7b75cde1ef5ec22f8 | |
parent | c4e1b4253d4731c91a6112f353c37a6a056b9f59 (diff) | |
download | chawan-420a716de6773c720b4d0af185294093825c037b.tar.gz |
stbi: fix broken allocation in resizing
;_;
-rw-r--r-- | adapter/img/stbi.nim | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/adapter/img/stbi.nim b/adapter/img/stbi.nim index 1bf634cc..e4580d5c 100644 --- a/adapter/img/stbi.nim +++ b/adapter/img/stbi.nim @@ -106,7 +106,7 @@ proc main() = stdout.write("Cha-Control: ConnectionError 1 stbi error " & $stbi_failure_reason()) elif targetWidth != -1 and targetHeight != -1: - let p2 = cast[ptr uint8](alloc(targetWidth * targetWidth * 4)) + let p2 = cast[ptr uint8](alloc(targetWidth * targetHeight * 4)) doAssert stbir_resize_uint8(p, x, y, 0, p2, targetWidth, targetHeight, 0, 4) == 1 stdout.write("Cha-Image-Dimensions: " & $targetWidth & "x" & |