:: commit 47e4e1823d9279ac837e034bd76aa8f337251d49

Kamila Szewczyk <27734421+kspalaiologos@users.noreply.github.com> — 2022-11-15 19:29

parents: ebd719c0f6

fail late in `lzp_decode_block`

diff --git a/src/libbz3.c b/src/libbz3.c
index e60d34c..66a3ca1 100644
--- a/src/libbz3.c
+++ b/src/libbz3.c
@@ -180,7 +180,7 @@ static s32 lzp_decode_block(const u8 * RESTRICT in, const u8 * in_end, s32 * RES
 
                 const u8 * ref = outs + val;
                 u8 * oe = out + len;
-                if (oe > out_end) return -1;
+                if (oe > out_end) oe = out_end;
 
                 while (out < oe) *out++ = *ref++;
 
tab: 248 wrap: offon