]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
[fuzzer] Fix stream_round_trip for the new options
authorNick Terrell <terrelln@fb.com>
Tue, 9 Apr 2019 04:06:19 +0000 (21:06 -0700)
committerNick Terrell <terrelln@fb.com>
Tue, 9 Apr 2019 04:06:19 +0000 (21:06 -0700)
tests/fuzz/stream_round_trip.c

index d903bcb29b11dceb32e193a3f4d780dd7c4d7c20..d13c2dbe7e006b668a437548479cc783217e1e62 100644 (file)
@@ -63,7 +63,7 @@ static size_t compress(uint8_t *dst, size_t capacity,
         ZSTD_inBuffer in = makeInBuffer(&src, &srcSize);
         /* Mode controls the action. If mode == -1 we pick a new mode */
         int mode = -1;
-        while (in.pos < in.size) {
+        while (in.pos < in.size || mode != -1) {
             ZSTD_outBuffer out = makeOutBuffer(dst, capacity);
             /* Previous action finished, pick a new mode. */
             if (mode == -1) mode = FUZZ_rand(&seed) % 10;