diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2008-09-27 19:09:21 +0300 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2008-09-27 19:09:21 +0300 |
commit | 1dcecfb09b55157b8653d747963069c8bed74f04 (patch) | |
tree | 81fa1f1e8bf6871981970ca826d897db6f33527b /src/liblzma/common/alone_decoder.c | |
parent | Added 7z2lzma.bash. (diff) | |
download | xz-1dcecfb09b55157b8653d747963069c8bed74f04.tar.xz |
Some API changes, bug fixes, cleanups etc.
Diffstat (limited to '')
-rw-r--r-- | src/liblzma/common/alone_decoder.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/liblzma/common/alone_decoder.c b/src/liblzma/common/alone_decoder.c index 45cb54e5..7ff29289 100644 --- a/src/liblzma/common/alone_decoder.c +++ b/src/liblzma/common/alone_decoder.c @@ -68,12 +68,11 @@ alone_decode(lzma_coder *coder, break; case SEQ_DICTIONARY_SIZE: - coder->options.dictionary_size + coder->options.dict_size |= (size_t)(in[*in_pos]) << (coder->pos * 8); if (++coder->pos == 4) { - if (coder->options.dictionary_size - > LZMA_DICTIONARY_SIZE_MAX) + if (coder->options.dict_size > (UINT32_C(1) << 30)) return LZMA_FORMAT_ERROR; // A hack to ditch tons of false positives: We allow @@ -81,7 +80,7 @@ alone_decode(lzma_coder *coder, // LZMA_Alone created only files with 2^n, but accepts // any dictionary size. If someone complains, this // will be reconsidered. - uint32_t d = coder->options.dictionary_size - 1; + uint32_t d = coder->options.dict_size - 1; d |= d >> 2; d |= d >> 3; d |= d >> 4; @@ -89,7 +88,7 @@ alone_decode(lzma_coder *coder, d |= d >> 16; ++d; - if (d != coder->options.dictionary_size) + if (d != coder->options.dict_size) return LZMA_FORMAT_ERROR; coder->pos = 0; @@ -199,7 +198,7 @@ lzma_alone_decoder_init(lzma_next_coder *next, lzma_allocator *allocator, next->coder->sequence = SEQ_PROPERTIES; next->coder->pos = 0; - next->coder->options.dictionary_size = 0; + next->coder->options.dict_size = 0; next->coder->uncompressed_size = 0; next->coder->memlimit = memlimit; |