diff options
author | Lode Vandevenne <lvandeve@users.noreply.github.com> | 2019-08-16 02:09:46 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-16 02:09:46 +0300 |
commit | 34742d48e586bd9960bf0d494fb3180cca84520a (patch) | |
tree | 9fbfaed9b49f9c5ac761b7e703378bcf0ea1e375 /lodepng.cpp | |
parent | 5a93513a44de0eafa9073503e8c88929910977ac (diff) | |
parent | 2e841453e40fc546c4431a124e68b0bd21ffc4c8 (diff) |
Merge pull request #104 from sezero/sezero3
HuffmanTree_cleanup: change initializer of mask to a real constant constant
Diffstat (limited to 'lodepng.cpp')
-rw-r--r-- | lodepng.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lodepng.cpp b/lodepng.cpp index e86c8a6..d613e1e 100644 --- a/lodepng.cpp +++ b/lodepng.cpp @@ -608,7 +608,7 @@ static void HuffmanTree_cleanup(HuffmanTree* tree) { /* make table for huffman decoding */ static unsigned HuffmanTree_makeTable(HuffmanTree* tree) { static const unsigned headsize = 1u << FIRSTBITS; /*size of the first table*/ - static const unsigned mask = headsize - 1u; + static const unsigned mask = (1u << FIRSTBITS) /*headsize*/ - 1u; size_t i, pointer, size; /*total table size*/ unsigned* maxlens = (unsigned*)lodepng_malloc(headsize * sizeof(unsigned)); if(!maxlens) return 83; /*alloc fail*/ |