summaryrefslogtreecommitdiffstats
path: root/programs/frametest.c
diff options
context:
space:
mode:
authorYann Collet <yann.collet.73@gmail.com>2014-09-10 12:00:39 (GMT)
committerYann Collet <yann.collet.73@gmail.com>2014-09-10 12:00:39 (GMT)
commit0400451ac22b9578274a3971ed65e6c70cd7fdb9 (patch)
tree77d33900b431be2047db09d272e2914a8c462453 /programs/frametest.c
parenteac83cd850d2f69a82ef9af344be9b7f3925681a (diff)
downloadlz4-0400451ac22b9578274a3971ed65e6c70cd7fdb9.zip
lz4-0400451ac22b9578274a3971ed65e6c70cd7fdb9.tar.gz
lz4-0400451ac22b9578274a3971ed65e6c70cd7fdb9.tar.bz2
Fix : streaming mode bug (re-using context & buffers)
Diffstat (limited to 'programs/frametest.c')
-rw-r--r--programs/frametest.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/programs/frametest.c b/programs/frametest.c
index 9db2379..efe1883 100644
--- a/programs/frametest.c
+++ b/programs/frametest.c
@@ -392,9 +392,9 @@ int fuzzerTests(U32 seed, unsigned nbTests, unsigned startTest, double compressi
for ( ; testNb < nbTests; testNb++)
{
U32 randState = coreRand ^ prime1;
- unsigned CCflag = FUZ_rand(&randState) & 1;
unsigned BSId = 4 + (FUZ_rand(&randState) & 3);
unsigned BMId = FUZ_rand(&randState) & 1;
+ unsigned CCflag = FUZ_rand(&randState) & 1;
LZ4F_preferences_t prefs = { { BSId, BMId, CCflag, 0,0,0 }, 0,0, 0,0,0,0 };
unsigned nbBits = (FUZ_rand(&randState) % (FUZ_highbit(srcDataLength-1) - 1)) + 1;
size_t srcSize = (FUZ_rand(&randState) & ((1<<nbBits)-1)) + 1;
@@ -445,6 +445,7 @@ int fuzzerTests(U32 seed, unsigned nbTests, unsigned startTest, double compressi
size_t oSize = (FUZ_rand(&randState) & ((1<<nbBitsO)-1)) + 1;
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);
CHECK(LZ4F_isError(result), "Decompression failed (error %i)", (int)result);
op += oSize;