diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2008-12-15 10:01:59 +0200 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2008-12-15 10:01:59 +0200 |
commit | ff7fb2c605bccc411069e07b9f11fb957aea2ddf (patch) | |
tree | c9055532dd69fb9a77147849bb28e55d3e63de6e /src/liblzma/lz/lz_decoder.h | |
parent | Name the package "xz" in configure.ac. (diff) | |
download | xz-ff7fb2c605bccc411069e07b9f11fb957aea2ddf.tar.xz |
Fix data corruption in LZMA2 decoder.
Diffstat (limited to '')
-rw-r--r-- | src/liblzma/lz/lz_decoder.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/liblzma/lz/lz_decoder.h b/src/liblzma/lz/lz_decoder.h index 53ee1c1e..5ac44057 100644 --- a/src/liblzma/lz/lz_decoder.h +++ b/src/liblzma/lz/lz_decoder.h @@ -45,6 +45,9 @@ typedef struct { /// Size of the dictionary size_t size; + /// True when dictionary should be reset before decoding more data. + bool need_reset; + } lzma_dict; @@ -224,9 +227,8 @@ dict_write(lzma_dict *restrict dict, const uint8_t *restrict in, static inline void dict_reset(lzma_dict *dict) { - dict->pos = 0; - dict->full = 0; - dict->buf[dict->size - 1] = '\0'; + dict->need_reset = true; + return; } #endif |