Merge pull request #859 from terrelln/31
Prepare for ZSTD_WINDOWLOG_MAX == 31
diff --git a/lib/decompress/zstd_decompress.c b/lib/decompress/zstd_decompress.c
index b07d77c..cd64f3b 100644
--- a/lib/decompress/zstd_decompress.c
+++ b/lib/decompress/zstd_decompress.c
@@ -1546,6 +1546,10 @@
if (blockProperties.lastBlock) break;
}
+ if (dctx->fParams.frameContentSize != ZSTD_CONTENTSIZE_UNKNOWN) {
+ if ((U64)(op-ostart) != dctx->fParams.frameContentSize) {
+ return ERROR(corruption_detected);
+ } }
if (dctx->fParams.checksumFlag) { /* Frame content checksum verification */
U32 const checkCalc = (U32)XXH64_digest(&dctx->xxhState);
U32 checkRead;
diff --git a/tests/fuzzer.c b/tests/fuzzer.c
index 2bc5c9d..bfa290c 100644
--- a/tests/fuzzer.c
+++ b/tests/fuzzer.c
@@ -811,7 +811,7 @@
}
DISPLAYLEVEL(4, "OK \n");
- DISPLAYLEVEL(4, "test%3i : Loading rawContent starting with dict header w/ ZSTD_dm_auto should fail", testNb++);
+ DISPLAYLEVEL(4, "test%3i : Loading rawContent starting with dict header w/ ZSTD_dm_auto should fail : ", testNb++);
{
size_t ret;
MEM_writeLE32((char*)dictBuffer+2, ZSTD_MAGIC_DICTIONARY);
@@ -821,7 +821,7 @@
}
DISPLAYLEVEL(4, "OK \n");
- DISPLAYLEVEL(4, "test%3i : Loading rawContent starting with dict header w/ ZSTD_dm_rawContent should pass", testNb++);
+ DISPLAYLEVEL(4, "test%3i : Loading rawContent starting with dict header w/ ZSTD_dm_rawContent should pass : ", testNb++);
{
size_t ret;
MEM_writeLE32((char*)dictBuffer+2, ZSTD_MAGIC_DICTIONARY);