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

Fix read in packbits decoder #193

Merged
merged 1 commit into from Dec 3, 2022
Merged

Conversation

HeroicKatora
Copy link
Member

This assumed that a read would succeed for the full length, thus interpreting in a subsequent call some data bits as a header.

For instance, consider 77 bytes of literal were left and a buffer of 1024 bytes was provided. Then the read call might return 60 which was ignored and assumed to be 77. Thus the next 17 bytes of literal data were instead interpreted as a header due to setting self.count to 0.

Closes: #192

This assumed that a `read` would succeed for the full length, thus
interpreting in a subsequent call some data bits as a header.

For instance, consider 77 bytes of literal were left and a buffer of
1024 bytes was provided. Then the `read` call might return 60 which was
ignored and assumed to be 77. Thus the next 17 bytes of literal data
were instead interpreted as a header due to setting `self.count` to 0.
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

Successfully merging this pull request may close these issues.

16-bit-per-channel images using PackBits compression fail to load correctly.
1 participant