f40ecc3f10
Motivation: The Snappy decoder was failing on valid inputs containing literals with 2-byte lengths > 0x8000 or copies with 2-byte offsets >= 0x8000. The decoder was also enforcing an artificially low offset limit of 0x7FFF, something the Snappy format description advises against, and which prevents decoding valid inputs generated by other encoders. Modifications: Interpret 2-byte literal lengths and 2-byte copy offsets as unsigned shorts, in accordance with the format description and reference implementation. Allow any positive offset value. Throw an appropriate exception for negative values (which can theoretically occur due to arithmetic overflow on 4-byte offsets, but are unlikely to occur in the wild). Result: The Snappy decoder can handle valid inputs that previously caused it to throw exceptions. |
||
---|---|---|
.. | ||
src | ||
pom.xml |