Change bzip stream code so it is similar to zlib stream code.

This commit is contained in:
Nathan Moinvaziri 2018-01-03 10:24:18 -08:00
parent d60c6d20af
commit fc746532d8

View File

@ -232,14 +232,16 @@ static int32_t mz_stream_bzip_compress(void *stream, int flush)
out_bytes = (uint32_t)(total_out_after - total_out_before);
bzip->buffer_len += out_bytes;
bzip->total_out += out_bytes;
if (err == BZ_STREAM_END)
break;
if (err < 0)
{
bzip->error = err;
return MZ_STREAM_ERROR;
}
bzip->buffer_len += out_bytes;
bzip->total_out += out_bytes;
}
while ((bzip->bzstream.avail_in > 0) || (flush == BZ_FINISH && err == BZ_FINISH_OK));