]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Fix break condition in decompression noise test 980/head
authorconor42 <ronoc74@yahoo.com>
Thu, 11 Jan 2018 01:42:58 +0000 (11:42 +1000)
committerGitHub <noreply@github.com>
Thu, 11 Jan 2018 01:42:58 +0000 (11:42 +1000)
The bug prevents noise being added

tests/fuzzer.c

index 141bf65484c1e7d000f6bf5fcc9f55ce69ef2131..0f82ee61e0593ae4d299517003468d99d79eb08a 100644 (file)
@@ -1412,7 +1412,7 @@ static int fuzzerTests(U32 seed, U32 nbTests, unsigned startTest, U32 const maxD
                         size_t const skipLength = FUZ_rand(&lseed) & mask;
                         pos += skipLength;
                     }
-                    if (pos <= cSize) break;
+                    if (pos >= cSize) break;
                     /* add noise */
                     {   U32 const nbBitsCodes = FUZ_rand(&lseed) % maxNbBits;
                         U32 const nbBits = nbBitsCodes ? nbBitsCodes-1 : 0;