Add an assert to make sure assumptions I am about to make will hold

Change-Id: Ifc1eeb61aa345cf177e3c5996ed7bc48f6aeb07c
This commit is contained in:
Tor Lillqvist 2017-01-04 14:36:13 +02:00
parent ae6f0e3df9
commit c8d3f90e56

View file

@ -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);