Skip to content

[bzip2] Reset bzip stream on any error.

Ben Wagner requested to merge bungeman/freetype:bzip2_reset_stream into master

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): initialize reset to 0. (ft_bzip2_file_reset): set reset to 0 after resetting. (ft_bzip2_file_fill_output): set reset to 1 when BZ2_bzDecompress returns anything other than BZ_OK.

Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43564

Merge request reports