Here's a not too ambitious attempt to clean up the error handling on zlib output. It's bit gross to treat any error reported by zlib as fatal, but it's a step up from ignoring them, and it's in the client code, not in the library. The first patch splits out the first fix of id:20200410173039.yextmxk4wtgpl4ud at siegel.lan The last patch is a fix for the bug reported by qsx.