pierrec / node-lz4

LZ4 fast compression algorithm for NodeJS
MIT License
438 stars 98 forks source link

C decoder does not accept valid offsets #57

Open alexfernandez opened 6 years ago

alexfernandez commented 6 years ago

I have tried to decompress the attached file (inside a .zip) with node-lz4, both with useJS and without it. With useJS it works fine; without it it does not. I suspect it is an issue with the C decoder, since I think it is valid. The offending sequence is in hex:

token: f1
literal length: 12
literal: 204f63742020332031323a33373a3437206b65726e656c3a205b20202020302e30
offset: 0100

It contains a literal of length 33 and then an offset of 01, which should be valid since it indicates to copy from the previous literal.

Thanks!

offsets.lz4.zip