dankar/pnglite — pull request #2 by SiegeLord (2012-05-10 05:33:42+00:00)
Title: Fix buffer overflow error when saving very small bitmaps.

For small bitmaps (8x8 in my case) of certain contents it seems that the compressed size is greater than the input data size, so a buffer overflow would occur. In fact, the compress function failed and returned Z_BUF_ERROR. This fix should be better in that respect, as compressBound returns the absolute maximum amount of memory needed for compression. It might adversely affect the saving of large bitmaps... but I doubt it'll do so significantly.