Hello Jacob,

Jacob Rief wrote:
now I wanted to implement a mechanism in my lzip stream, in order to
forward to the next valid member using LZ_decompress_sync_to_member.

You should not use LZ_decompress_reset in this case, because it discards all written data. LZ_decompress_reset "resets the internal state of DECODER as it was just after opening it with the `LZ_decompress_open' function."

The following should work:
  1) LZ_decompress_open
     the (compressed) input stream does not start with a valid LZIP header
  2) LZ_decompress_write
  3) LZ_decompress_sync_to_member
     now do a decompression as usual (write/read). LZ_decompress_read will
     return 0 until a header is found. Decompression restarts then from
     the stream position of the header found.

You should be able to switch steps 2-3 to easily remove leading garbage from the lzip compressed stream.


Regards,
Antonio.


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

Reply via email to