From 796b000e5951bc1ab4818d0207be63b49c4d52ca Mon Sep 17 00:00:00 2001 From: JayXon Date: Mon, 20 Mar 2017 21:16:08 -0700 Subject: 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. --- lodepng.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)*/ -- cgit v1.2.3