-
Notifications
You must be signed in to change notification settings - Fork 70
Open
Description
The reader loop in decompress.hpp suppresses Z_BUF_ERROR so it doesn't detect truncated input files.
I think the right way to do it is probably as in this change to Tippecanoe's code copied and pasted from the same place: mapbox/tippecanoe@07ab900.
With this change, the loop terminates only on Z_STREAM_END, so in the case of a truncated stream, it continues trying to decompress and reports Z_BUF_ERROR instead of the current behavior of terminating because the input has all been consumed even though the decompressor is still expecting more.
This also attempts to clean up what has always seemed like confusing logic to me about the size of the output buffer, the size of the output so far, and zlib's pointers into the buffer.
Metadata
Metadata
Assignees
Labels
No labels