lvandeve / lodepng

PNG encoder and decoder in C and C++.
zlib License
2.04k stars 420 forks source link

Decoding error 55: jumped past tree while generating huffman tree #114

Closed JayXon closed 4 years ago

JayXon commented 4 years ago

After zopfli updated to latest lodepng (https://github.com/google/zopfli/commit/5d9b71b3c636e9e14a8f7a3f983ff93a1a3793ac), I've noticed that some png failed to decode with error 55, but the image is displayed just fine by other software, is lodepng being too strict or the image is actually broken?

Test file: 05-c3-c2

lvandeve commented 4 years ago

Thanks for reporting! Found what it is and fixed in commit https://github.com/lvandeve/lodepng/commit/3606db5a71359a4165308e7cd5afe67bd42f7edf, it was broken support for huffman trees with 0 or 1 actual symbols in it after rewriting the huffman decoding to be faster.

JayXon commented 4 years ago

Thanks for the quick fix! Could you update lodepng in zopfli again?

lvandeve commented 4 years ago

Yep, done