diff options
author | Lode Vandevenne <lvandeve@users.noreply.github.com> | 2022-06-18 17:40:12 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-18 17:40:12 +0300 |
commit | 43d56186f9da45d72373ba1cca8f8b347ccec635 (patch) | |
tree | 31d976e2b78fa04f1b1bc43613db8f100dbbbd85 /lodepng.cpp | |
parent | 884b57e4dd5e23b9de4fd0e6dc05322768e0d0b6 (diff) | |
parent | 8242b9a544be21321ff987e0e6fa51a02c36e577 (diff) |
Merge pull request #168 from vitalybuka/master
Continue early to avoid uninitialized value
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 056a100..3cc0160 100644 --- a/lodepng.cpp +++ b/lodepng.cpp @@ -711,10 +711,10 @@ static unsigned HuffmanTree_makeTable(HuffmanTree* tree) { numpresent = 0; for(i = 0; i < tree->numcodes; ++i) { unsigned l = tree->lengths[i]; + if(l == 0) continue; unsigned symbol = tree->codes[i]; /*the huffman bit pattern. i itself is the value.*/ /*reverse bits, because the huffman bits are given in MSB first order but the bit reader reads LSB first*/ unsigned reverse = reverseBits(symbol, l); - if(l == 0) continue; numpresent++; if(l <= FIRSTBITS) { |