fix decompression copying out of wasm heap

This commit is contained in:
Lily Tsuru 2024-07-09 23:09:32 -04:00
parent 1ed14d58f1
commit 57b272becf

View file

@ -54,5 +54,5 @@ export function compressDecompress(src: Uint8Array, dest: Uint8Array) {
throw new Error(`decompression failed: ${nrBytesDecompressed} != ${dest.length}`); throw new Error(`decompression failed: ${nrBytesDecompressed} != ${dest.length}`);
// Dest will be memory[src.length..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);
} }