summaryrefslogtreecommitdiffstats
path: root/lz4frame.c
diff options
context:
space:
mode:
authorYann Collet <yann.collet.73@gmail.com>2014-09-13 20:21:41 (GMT)
committerYann Collet <yann.collet.73@gmail.com>2014-09-13 20:21:41 (GMT)
commit457dc35e6a56aab12e060af608efd1cbb0eec8a9 (patch)
treecc22076d6691084f23e1de81678723ae2808cc17 /lz4frame.c
parent56c2b79ed015d4b154d4bd3a9cab27e7c613ba51 (diff)
downloadlz4-457dc35e6a56aab12e060af608efd1cbb0eec8a9.zip
lz4-457dc35e6a56aab12e060af608efd1cbb0eec8a9.tar.gz
lz4-457dc35e6a56aab12e060af608efd1cbb0eec8a9.tar.bz2
Restored variable output size fuzzer test
Quickfix frame decompression Small speed optimization frame decompression
Diffstat (limited to 'lz4frame.c')
-rw-r--r--lz4frame.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/lz4frame.c b/lz4frame.c
index 390af0e..7bc2319 100644
--- a/lz4frame.c
+++ b/lz4frame.c
@@ -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;
}