xiaoyin0208 / lz4

Automatically exported from code.google.com/p/lz4
0 stars 0 forks source link

LZ4_uncompress_unknownOutputSize will return negativ if maxOutputSize is smaller than chunkSize #58

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. uncompress with LZ4_uncompress_unknownOutputSize using a buffer thats 
smaller than the chunkSize

What is the expected output? What do you see instead?

I would expect a positiv status return to enlarge the buffer. I get a negative 
status, indicating an error

What version of the product are you using? On what operating system?

r87, Mac OS X 10.8

Please provide any additional information below.

Original issue reported on code.google.com by d...@bbcgmbh.de on 1 Jan 2013 at 11:01

GoogleCodeExporter commented 8 years ago
(with "buffer thats smaller than the chunkSize" i meant that the size of the 
buffer is smaller than chunkSize after decompression)

Original comment by d...@bbcgmbh.de on 1 Jan 2013 at 11:03

GoogleCodeExporter commented 8 years ago
Well, imho, this is a correct behavior.
The function cannot decompress data, because it has not enough place to 
decompress it.
So it returns an error, which is a negative value.

If it would return a positive value, then it would mean that it successfully 
decoded the compressed stream, and the value would be the size of decoded data.

Original comment by yann.col...@gmail.com on 1 Jan 2013 at 11:21

GoogleCodeExporter commented 8 years ago
So i should just arbitrarily choose a large enough buffer size? I honestly 
would expect to have the chance to increase the buffer size (for example gzip 
offers this functionality). The function could just decompress the data until 
the buffer is full and then request the buffer to be increased.

Original comment by d...@bbcgmbh.de on 1 Jan 2013 at 11:25

GoogleCodeExporter commented 8 years ago
What you seem to request will be part of the LZ4 streaming interface, which is 
still a work in progress.
For the time being, the LZ4 "raw format" as delivered here is a block-oriented 
algorithm. You are supposed to know the size of data to decode, or at least to 
know the maximum size of data to decode. How this information is transmitted is 
outside of the scope of LZ4 "raw format".

Original comment by yann.col...@gmail.com on 2 Jan 2013 at 12:15

GoogleCodeExporter commented 8 years ago
Closed. Will be part of the LZ4 streaming interface.

Original comment by yann.col...@gmail.com on 3 Jan 2013 at 3:24