From ad218a6c9ca140200839d43f12bb1e84c8c380d4 Mon Sep 17 00:00:00 2001 From: Chris Hennick <4961925+Pr0methean@users.noreply.github.com> Date: Mon, 3 Jun 2024 20:23:46 -0700 Subject: [PATCH] ci(fuzz): Allow zopfli_buffer_size to be 3 * power of 2 --- src/write.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/write.rs b/src/write.rs index acf9ac98..82764af6 100644 --- a/src/write.rs +++ b/src/write.rs @@ -287,7 +287,11 @@ impl<'a> arbitrary::Arbitrary<'a> for FileOptions<'a, ExtendedFileOptions> { }; #[cfg(feature = "deflate-zopfli")] if options.compression_method == CompressionMethod::Deflated && bool::arbitrary(u)? { - options.zopfli_buffer_size = Some(1 << u.int_in_range(9..=30)?); + options.zopfli_buffer_size = Some(1 << u.int_in_range(8..=29)? * if bool::arbitrary(u) { + 2 + } else { + 3 + }); } u.arbitrary_loop(Some(0), Some((u16::MAX / 4) as u32), |u| { options