]> icculus.org git repositories - icculus/xz.git/commit
Fix a buffer overflow in the LZMA encoder. It was due to my
authorLasse Collin <lasse.collin@tukaani.org>
Sun, 1 Jun 2008 09:48:17 +0000 (12:48 +0300)
committerLasse Collin <lasse.collin@tukaani.org>
Sun, 1 Jun 2008 09:48:17 +0000 (12:48 +0300)
commit369f72fd656f537a9a8e06f13e6d0d4c242be22f
tree7b0d983e6be1ebb4d1361b2efcd125eeacad97a0
parente55e0e873ce2511325749d415ae547d62ab5f00d
Fix a buffer overflow in the LZMA encoder. It was due to my
misunderstanding of the code. There's no tiny fix for this
problem, so I also cleaned up the code in general.

This reduces the speed of the encoder 2-5 % in the fastest
compression mode ("lzma -1"). High compression modes should
have no noticeable performance difference.

This commit breaks things (especially LZMA_SYNC_FLUSH) but I
will fix them once the new format and LZMA2 has been roughly
implemented. Plain LZMA won't support LZMA_SYNC_FLUSH at all
and won't be supported in the new .lzma format. This may
change still but this is what it looks like now.

Support for known uncompressed size (that is, LZMA or LZMA2
without EOPM) is likely to go away. This means there will
be API changes.
src/liblzma/lz/lz_encoder.c
src/liblzma/lz/lz_encoder.h
src/liblzma/lzma/lzma_encoder.c
src/liblzma/lzma/lzma_encoder_getoptimum.c
src/liblzma/lzma/lzma_encoder_getoptimumfast.c
src/liblzma/lzma/lzma_encoder_init.c
src/liblzma/lzma/lzma_encoder_private.h
src/liblzma/rangecoder/range_encoder.h