diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2008-09-13 13:54:00 +0300 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2008-09-13 13:54:00 +0300 |
commit | 13d68b069849e19c33822cd8996cd6447890abb1 (patch) | |
tree | 0a6d19e55e543012a933aea100898722defced0d | |
parent | Renamed constants: (diff) | |
download | xz-13d68b069849e19c33822cd8996cd6447890abb1.tar.xz |
LZ decoder cleanup
-rw-r--r-- | src/liblzma/lz/lz_decoder.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/liblzma/lz/lz_decoder.c b/src/liblzma/lz/lz_decoder.c index 0344ae6a..d4bd59f2 100644 --- a/src/liblzma/lz/lz_decoder.c +++ b/src/liblzma/lz/lz_decoder.c @@ -219,12 +219,11 @@ lzma_lz_decoder_init(lzma_next_coder *next, lzma_allocator *allocator, // dictionary to the output buffer, since applications are // recommended to give aligned buffers to liblzma. // - // Avoid integer overflow. FIXME Should the return value be - // LZMA_OPTIONS_ERROR or LZMA_MEM_ERROR? + // Avoid integer overflow. if (dict_size > SIZE_MAX - 15) return LZMA_MEM_ERROR; - dict_size = (dict_size + 15) & (SIZE_MAX - 15); + dict_size = (dict_size + 15) & ~((size_t)(15)); // Allocate and initialize the dictionary. if (next->coder->dict.size != dict_size) { |