Hello Antonio,
hmm, then shouldn't it be
1) if the decompressor was not yet initialized, then LZ_decompress_open
   Ann.: the (compressed) input stream is somewhere in the middle of
a chunk and therefore effectively rubbish.
    is an LZ_decompress_write here a must?
2) LZ_decompress_sync_to_member
3) LZ_decompress_write
4) go back to step 3 until LZ_decompress_read returnes > 0
continue with decompression as usual

In the current algorithm, I don't understand why LZ_decompress_write
is before LZ_decompress_sync_to_member?

Regards,
Jacob

> 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