From d564c1ecb8e1ea2ab062cc33007202d351a16cc3 Mon Sep 17 00:00:00 2001 From: Emmanuel Marty Date: Sat, 8 Jun 2019 19:03:33 +0200 Subject: [PATCH] Fixes --- src/lzsa.c | 2 +- src/shrink_inmem.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lzsa.c b/src/lzsa.c index 856a02f..e11c1bc 100755 --- a/src/lzsa.c +++ b/src/lzsa.c @@ -474,7 +474,7 @@ static int do_self_test(const unsigned int nOptions, const int nMinMatchSize, in float fMatchProbability; fprintf(stdout, "size %zd", nGeneratedDataSize); - for (fMatchProbability = ((nOptions & OPT_RAW) ? 0.5f : 0.1f); fMatchProbability <= 0.995f; fMatchProbability += fProbabilitySizeStep) { + for (fMatchProbability = ((nOptions & OPT_RAW) ? 0.5f : 0); fMatchProbability <= 0.995f; fMatchProbability += fProbabilitySizeStep) { int nNumLiteralValues[12] = { 1, 2, 3, 15, 30, 56, 96, 137, 178, 191, 255, 256 }; float fXorProbability; diff --git a/src/shrink_inmem.c b/src/shrink_inmem.c index 0ead0e4..aecc2ed 100644 --- a/src/shrink_inmem.c +++ b/src/shrink_inmem.c @@ -106,7 +106,7 @@ size_t lzsa_compress_inmem(const unsigned char *pInputData, unsigned char *pOutB if ((nFlags & LZSA_FLAG_RAW_BLOCK) != 0) { nFrameSize = 0; - nOutDataEnd = (int)(nMaxOutBufferSize); + nOutDataEnd = (int)(nMaxOutBufferSize - nCompressedSize); } if (nOutDataEnd > BLOCK_SIZE)