summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJayXon <jayxon@gmail.com>2017-03-20 21:16:08 -0700
committerJayXon <jayxon@gmail.com>2017-03-20 21:16:08 -0700
commit796b000e5951bc1ab4818d0207be63b49c4d52ca (patch)
treec77c391230a1d454a1e24207cf75812f61e41b74
parent8a0f16afe74a6abf85e3b45e9558283022021a59 (diff)
Fix wrong error code if huffmanDecodeSymbol fail
The return value of huffmanDecodeSymbol is stored in code_d not code_ll, code_ll is between 257 and 285 here.
-rw-r--r--lodepng.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lodepng.cpp b/lodepng.cpp
index bf237df..95bc92e 100644
--- a/lodepng.cpp
+++ b/lodepng.cpp
@@ -1171,7 +1171,7 @@ static unsigned inflateHuffmanBlock(ucvector* out, const unsigned char* in, size
code_d = huffmanDecodeSymbol(in, bp, &tree_d, inbitlength);
if(code_d > 29)
{
- if(code_ll == (unsigned)(-1)) /*huffmanDecodeSymbol returns (unsigned)(-1) in case of error*/
+ if(code_d == (unsigned)(-1)) /*huffmanDecodeSymbol returns (unsigned)(-1) in case of error*/
{
/*return error code 10 or 11 depending on the situation that happened in huffmanDecodeSymbol
(10=no endcode, 11=wrong jump outside of tree)*/