static void LZ4F_pointDict(LZ4F_dctx_internal_t* dctxPtr, const BYTE* decoded, size_t decodedSize)
{
- /* large decoded block */
- if (decodedSize >= (64 KB - 1))
- {
- dctxPtr->dict = (BYTE*)decoded;
- dctxPtr->dictSize = decodedSize;
- dctxPtr->tmpOut = dctxPtr->tmpOutBuffer + 64 KB;
- return;
- }
-
/* decoded block in the continuity of dictionary */
if (dctxPtr->dict + dctxPtr->dictSize == decoded)
{
return;
}
+ /* large decoded block */
+ if (decodedSize >= (64 KB - 1))
+ {
+ dctxPtr->dict = (BYTE*)decoded;
+ dctxPtr->dictSize = decodedSize;
+ dctxPtr->tmpOut = dctxPtr->tmpOutBuffer + 64 KB;
+ return;
+ }
+
/* small block, and not contiguous : let's save that */
LZ4F_saveDict(dctxPtr, decoded, decodedSize);
}
break;
}
dctxPtr->dStage = dstage_getCBlock;
+ if (dstPtr==dstEnd)
+ {
+ nextSrcSizeHint = nextCBlockSize + 4;
+ doAnotherStage = 0;
+ }
break;
}
while (ip < iend)
{
unsigned nbBitsI = (FUZ_rand(&randState) % (maxBits-1)) + 1;
- unsigned nbBitsO = (FUZ_rand(&randState) % (maxBits-1)) + 1;
+ unsigned nbBitsO = (FUZ_rand(&randState) % (maxBits)) + 1;
size_t iSize = (FUZ_rand(&randState) & ((1<<nbBitsI)-1)) + 1;
- size_t oSize = (FUZ_rand(&randState) & ((1<<nbBitsO)-1)) + 1;
+ size_t oSize = (FUZ_rand(&randState) & ((1<<nbBitsO)-1)) + 2;
if (iSize > (size_t)(iend-ip)) iSize = iend-ip;
if (oSize > (size_t)(oend-op)) oSize = oend-op;
- oSize = oend-op;
result = LZ4F_decompress(dCtx, op, &oSize, ip, &iSize, NULL);
if (result == (size_t)-ERROR_checksum_invalid) locateBuffDiff((BYTE*)srcBuffer+srcStart, decodedBuffer, srcSize);
CHECK(LZ4F_isError(result), "Decompression failed (error %i)", (int)result);