aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/lz/lz_encoder.h
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2009-08-16 22:15:13 +0300
committerLasse Collin <lasse.collin@tukaani.org>2009-08-16 22:15:13 +0300
commit3ce1916c83041113b9cad9ead5c97a527cf8aa1d (patch)
treefd072d8e9c6e73ba0202712027e6204ec959f0c3 /src/liblzma/lz/lz_encoder.h
parentUpdated INSTALL and PACKAGERS to match the changes (diff)
downloadxz-3ce1916c83041113b9cad9ead5c97a527cf8aa1d.tar.xz
Fix data corruption in LZ/LZMA2 encoder.
Thanks to Jonathan Stott for the bug report.
Diffstat (limited to '')
-rw-r--r--src/liblzma/lz/lz_encoder.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/liblzma/lz/lz_encoder.h b/src/liblzma/lz/lz_encoder.h
index 4904c229..35e9ebbf 100644
--- a/src/liblzma/lz/lz_encoder.h
+++ b/src/liblzma/lz/lz_encoder.h
@@ -234,7 +234,7 @@ mf_avail(const lzma_mf *mf)
static inline uint32_t
mf_unencoded(const lzma_mf *mf)
{
- return mf->write_pos - mf->read_pos - mf->read_ahead;
+ return mf->write_pos - mf->read_pos + mf->read_ahead;
}