lvandeve / lodepng

PNG encoder and decoder in C and C++.
zlib License
2.08k stars 425 forks source link

allocate "reserved_size" extra memory #185

Open HiromichiMatsumura opened 9 months ago

HiromichiMatsumura commented 9 months ago

Hello,

I've tried to implement the current version of lodepng into an embedded system. I have a question.

In the "inflateHuffmanBlock" function, it resizes the memory size with reference to the "reserved_size (260)" value. Therefore, I believe it would be better to allocate "reserved_size" extra memory in the "zlib_decompress" function. Would this pose any problems?

I would appreciate it if you could reply.