lzip-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Lzip-bug] LZ_decompress_finished before LZ_decompress_read


From: Jacob Rief
Subject: [Lzip-bug] LZ_decompress_finished before LZ_decompress_read
Date: Thu, 3 Dec 2009 12:36:49 +0100

Hello Antonio,
currently I am adding LZMA support to an existing streaming library
using your lzlib implementation.

Up to now I can stream out and stream in data, however there is
something I am wondering about.
The stream has been implemented using your schema:

 1) LZ_decompress_open
 2) LZ_decompress_write
 3) LZ_decompress_read
 4) go back to step 2 until the input stream reached it's end
 5) LZ_decompress_finish
 6) LZ_decompress_read
 7) go back to step 6 until LZ_decompress_finished returns 1
this is OK, but LZ_decompress_finished only returns 1 after
LZ_decompress_read has returned with -1, setting LZ_decompress_errno
to LZ_header_error.
 8) LZ_decompress_close
This implementation works fine, but from the point of view of an API
client, I would expect for cleanness and symmetry reasons that
LZ_decompress_finished returns 1 BEFORE LZ_decompress_read
returns an error. This would allow to always check for LZ_ok
immediately after LZ_decompress_read. So, is this a feature
or a bug?

Thanks, Jacob




reply via email to

[Prev in Thread] Current Thread [Next in Thread]