Jacob Rief wrote:
Resetting the internal flags to a state equivalent to a decoder just after
creation can't work. Suppose the next header has not been yet fed to
LZ_decompress_write. You'll have to switch to a "search" state, then write
data until the header is found.

I assumed that the API client already forwarded its steam to the
beginning of the next member, which means that the first bytes written
using LZ_decompress_write(decoder, ...) are 'LZIP...'. That's the way
I did it for now.

This would unnecessarily skip a whole member if the next header has been already written with LZ_decompress_write and the error happens before the decoder reads the header from the internal buffer.

Same if the header has been partially written with LZ_decompress_write.

It seems to me that switching to a "search" state, writing data, and letting the decoder find the header is the safest approach.


Regards,
Antonio.


_______________________________________________
Lzip-bug mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lzip-bug

Reply via email to