- // Recover our buffer for writing into:
- Vector<unsigned char>* const encoded_img = static_cast< Vector<unsigned char>* >( png_get_io_ptr(png_ptr) );
- if(encoded_img)
- {
- const Vector<unsigned char>::SizeType bufferSize = encoded_img->Count();
- encoded_img->Resize( bufferSize + length ); //< Can throw OOM.
- unsigned char* const bufferBack = encoded_img->Begin() + bufferSize;
- memcpy(bufferBack, data, length);
- }
- else
- {
- DALI_LOG_ERROR("PNG buffer for write to memory was passed from libpng as null.\n");
- }
+ const Vector<unsigned char>::SizeType bufferSize = encoded_img->Count();
+ encoded_img->Resize(bufferSize + length); //< Can throw OOM.
+ unsigned char* const bufferBack = encoded_img->Begin() + bufferSize;
+ memcpy(bufferBack, data, length);