flate2-rs icon indicating copy to clipboard operation
flate2-rs copied to clipboard

Bad output when compressing empty array, with Compression::none()

Open xNxExOx opened this issue 8 months ago • 4 comments
trafficstars

I think this test example is enough to demonstrate the issue: Rust Playground

You can uncomment dbg!(&compressed_table); to see the huge result, that can not be decompressed afterwards.

Priority low, I resolved the issue on my side by using flate2::Compression::default() for empty tables, which works fine.

This is really weird edge case, so no need to fix it any time soon, because not many people is compressing empty stuff, and even less does so with flate2::Compression::none().

xNxExOx avatar Feb 28 '25 12:02 xNxExOx