[bzip2] Reset bzip stream on any error.
According to the bzip documentation it is undefined what will happen if
BZ2_bzDecompress
is called on a bz_stream
it has previously returned
an error against. If BZ2_bzDecompress
returns anything other than
BZ_OK
the only valid next action is BZ2_bzDecompressEnd
.
- src/bzip2/ftbzip2.c (FT_BZip2FileRec_): add
reset
to track the need to reset the stream. (ft_bzip2_file_init): initializereset
to 0. (ft_bzip2_file_reset): setreset
to 0 after resetting. (ft_bzip2_file_fill_output): setreset
to 1 whenBZ2_bzDecompress
returns anything other thanBZ_OK
.
Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43564