Skip to content
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

TIFFDeflater corrupts output for incompressible image #290

Open
davispw opened this issue Sep 14, 2023 · 1 comment
Open

TIFFDeflater corrupts output for incompressible image #290

davispw opened this issue Sep 14, 2023 · 1 comment

Comments

@davispw
Copy link

davispw commented Sep 14, 2023

The allocated compData byte array isn't big enough for the worst case.

For a use case I've tested, the worst case is 5 bytes per 16k, not 32k—although in general it's more complicated.

@davispw
Copy link
Author

davispw commented Sep 14, 2023

Using DeflaterOutputStream instead of Deflater would be one solution. It seems to me it's not necessary to preallocate this array.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant