:: commit 5aa125d5377b4034b10b46fe6d3957f992ad3240

Kamila Szewczyk <kspalaiologos@gmail.com> — 2022-05-06 15:07

parents: 0c75f86b21

pt2 of the fix

diff --git a/src/lzp.c b/src/lzp.c
index 98a932c..b35177b 100644
--- a/src/lzp.c
+++ b/src/lzp.c
@@ -92,7 +92,7 @@ static s32 lzp_encode_block(const u8 * restrict in, const u8 * in_end, u8 * rest
 static s32 lzp_decode_block(const u8 * restrict in, const u8 * in_end, s32 * restrict lut, u8 * restrict out, s32 hash, s32 m_len) {
     if (in_end - in < 4) return -1;
 
-    memset(lut, 0, sizeof(s32) * hash);
+    memset(lut, 0, sizeof(s32) * (1 << hash));
 
     u32 mask = (s32)(1 << hash) - 1;
     const u8 * outs = out;
tab: 248 wrap: offon