Skip to content
This repository has been archived by the owner on Sep 13, 2022. It is now read-only.

Stream with distance reference over 1024 doesn't decompress correctly #5

Closed
quicklyfrozen opened this issue Jan 26, 2012 · 1 comment

Comments

@quicklyfrozen
Copy link

The issue is that some distance codes need more then 8 extra distance bits, and the existing read_bits function didn't handle that case (it only appears to allow for extracting 8 bits). I changed the line that parses out the value to:

val = d.tag & (0xffff >> (16 - num));

and it seems to be decoding my stream correctly.

I am using this to decode a live stream so I don't have sample data readily available to submit with this report, although I could try to generate some.

BTW, I appreciate the readability of this code vs. most other deflate implementations that I looked at.

@quicklyfrozen
Copy link
Author

Oops, I reported this to the wrong project. Sorry about that.

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

No branches or pull requests

1 participant