common/Png.hpp | 3 +++ 1 file changed, 3 insertions(+) New commits: commit c8d3f90e56459238648f8e7830ed05d9bdd28951 Author: Tor Lillqvist <t...@collabora.com> Date: Wed Jan 4 14:36:13 2017 +0200
Add an assert to make sure assumptions I am about to make will hold Change-Id: Ifc1eeb61aa345cf177e3c5996ed7bc48f6aeb07c diff --git a/common/Png.hpp b/common/Png.hpp index b3c0863..ab6a795 100644 --- a/common/Png.hpp +++ b/common/Png.hpp @@ -127,6 +127,9 @@ bool encodeSubBufferToPNG(unsigned char* pixmap, size_t startX, size_t startY, return false; } + // This function seems to be always called with an empty _output_ vector. Make sure we can rely on that. + assert(output.size() == 0); + png_set_IHDR(png_ptr, info_ptr, width, height, 8, PNG_COLOR_TYPE_RGB_ALPHA, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); png_set_write_fn(png_ptr, &output, user_write_fn, user_flush_fn); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits