diff --git a/src/common/PNGLibrary.cxx b/src/common/PNGLibrary.cxx index 8a4ef0954..e5c092e6e 100644 --- a/src/common/PNGLibrary.cxx +++ b/src/common/PNGLibrary.cxx @@ -394,11 +394,11 @@ bool PNGLibrary::allocateStorage(size_t width, size_t height, bool hasAlpha) // Create space for the entire image (3(4) bytes per pixel in RGB(A) format) const size_t req_buffer_size = width * height * (hasAlpha ? 4 : 3); if(req_buffer_size > ReadInfo.buffer.capacity()) - ReadInfo.buffer.reserve(req_buffer_size * 1.5); + ReadInfo.buffer.resize(req_buffer_size * 1.5); const size_t req_row_size = height; if(req_row_size > ReadInfo.row_pointers.capacity()) - ReadInfo.row_pointers.reserve(req_row_size * 1.5); + ReadInfo.row_pointers.resize(req_row_size * 1.5); ReadInfo.width = static_cast(width); ReadInfo.height = static_cast(height);