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)