summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSlowRiot <rain.backnet@gmail.com>2014-11-27 05:16:52 +0000
committerSlowRiot <rain.backnet@gmail.com>2014-11-27 05:16:52 +0000
commit10bb7cafbd37b21ef404d7c5273ebde4d6be6402 (patch)
treea2ce70a8f86fdb223b5cebd990a25352f2db0d6b
parente205cb35be0d53730ee8c8c8082255d3f50c5d12 (diff)
fixing preincrement bug introduced previously
-rw-r--r--lodepng.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lodepng.cpp b/lodepng.cpp
index 1b1a0bd..355cd82 100644
--- a/lodepng.cpp
+++ b/lodepng.cpp
@@ -629,7 +629,7 @@ static unsigned HuffmanTree_makeFromLengths2(HuffmanTree* tree)
/*step 3: generate all the codes*/
for(unsigned n = 0; n != tree->numcodes; ++n)
{
- if(tree->lengths[n] != 0) tree->tree1d[n] = ++nextcode.data[tree->lengths[n]];
+ if(tree->lengths[n] != 0) tree->tree1d[n] = nextcode.data[tree->lengths[n]]++;
}
}