barnson / miniz

Automatically exported from code.google.com/p/miniz
1 stars 1 forks source link

1 byte input & output buffer not working #1

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. port the example buftest.c and xzminidec.c from the xz-embedded library to 
miniz with a 1 byte input and output buffer

What is the expected output? What do you see instead?
I see duplicated bytes in the output

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

Please provide any additional information below.
I think porting the test/examples/demos from the xz-embedded or the xz library 
proper and/or other decompression libraries and including them into miniz would 
be a good idea.

Original issue reported on code.google.com by janez...@gmail.com on 20 Jul 2011 at 6:21

GoogleCodeExporter commented 9 years ago
I discussed this issue with Janez by email, tinfl has an output buffer 
requirement that wasn't well commented in earlier release. tinfl is purposely 
designed this way- the higher level API's in miniz (such as the zlib-emulation 
functions) support tiny input/output buffer.

tinfl requires that the output buffer be either the size of the decompressed 
output stream (a "non-wrapping" output buffer - you must specify the proper 
tinfl flag to enable this), or the output buffer must be a power of 2 size that 
is at least as large as the LZ dictionary (typically 32KB). The input buffer 
for decompression can be 1 byte, and I've tested this on many files. 

Original comment by richge...@gmail.com on 19 May 2012 at 11:43