-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bad output when compressing empty array, with Compression::none() #474
Comments
Which version of miniz_oxide is it using? There was a bug introduced in miniz_oxide 0.8.3 that I fixed in 0.8.5 that caused corrupt output in this case so maybe rust playground hasn't updated yet. I was considering yanking the two versions though it seemed like an extreme edge case to happen in the wild though I guess if it does occur maybe I should as people can be slow to update. You very rarely want to intentionally use no compression as zlib and other compressors already switch to it automatically if the data is not compressible (though there are probably edge cases where you would to intentionally not compress it for whatever reason). An "empty" file will be smaller with any compression level higher than |
Well my reason for using For me locally I have: And finding out that one of the tables is empty was surprise for me, so that is huge edge case too. |
Even |
If you run |
0.8.4 has an edge case bug, see rust-lang#474
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()
.The text was updated successfully, but these errors were encountered: