diff options
Diffstat (limited to 'lz4frame.c')
-rw-r--r-- | lz4frame.c | 23 |
1 files changed, 14 insertions, 9 deletions
@@ -775,15 +775,6 @@ static void LZ4F_saveDict(LZ4F_dctx_internal_t* dctxPtr, const BYTE* decoded, si 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) { @@ -800,6 +791,15 @@ static void LZ4F_pointDict(LZ4F_dctx_internal_t* dctxPtr, const BYTE* decoded, s 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); } @@ -953,6 +953,11 @@ size_t LZ4F_decompress(LZ4F_decompressionContext_t decompressionContext, break; } dctxPtr->dStage = dstage_getCBlock; + if (dstPtr==dstEnd) + { + nextSrcSizeHint = nextCBlockSize + 4; + doAnotherStage = 0; + } break; } |