From 57b272becf3ee2d1b1bf623487104b5412afab94 Mon Sep 17 00:00:00 2001 From: modeco80 Date: Tue, 9 Jul 2024 23:09:32 -0400 Subject: [PATCH] fix decompression copying out of wasm heap --- msagent.js/src/decompress.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/msagent.js/src/decompress.ts b/msagent.js/src/decompress.ts index a4bbd03..4eaa93a 100644 --- a/msagent.js/src/decompress.ts +++ b/msagent.js/src/decompress.ts @@ -54,5 +54,5 @@ export function compressDecompress(src: Uint8Array, dest: Uint8Array) { throw new Error(`decompression failed: ${nrBytesDecompressed} != ${dest.length}`); // Dest will be memory[src.length..dest.length] - dest.set(copyBuffer.slice(src.length, dest.length), 0); + dest.set(copyBuffer.slice(src.length, src.length + dest.length), 0); }