Testing reveals a corner case where progress output is incorrect because the decompression can pass over multiple blocks in a single call. Make sure that the progress callback is always called once for each block that is decompressed.
Make file headers for directories (-lhd-) have a NULL filename when read from a level 0/1 header, for consistency with level 2/3 headers. Fix various code that assumes a non-NULL filename and sanity check to ensure one of either path or filename is always non-NULL.
If a new block is started with a length of zero, the count would be subtracted leading to an integer wraparound, with the result that the program could continue generating data indefinitely without any input. Use a while() loop to ensure that the new block has a size greater than zero, beginning a new block again immediately if an empty one is encountered.