diff --git a/src/plugins/printsupport/windows/qwindowsprintdevice.cpp b/src/plugins/printsupport/windows/qwindowsprintdevice.cpp index 071bc01192..f01e93d611 100644 --- a/src/plugins/printsupport/windows/qwindowsprintdevice.cpp +++ b/src/plugins/printsupport/windows/qwindowsprintdevice.cpp @@ -210,7 +210,7 @@ void QWindowsPrintDevice::loadPageSizes() const && DeviceCapabilities((LPWSTR)m_id.utf16(), NULL, DC_PAPERS, NULL, NULL) == paperCount) { QScopedArrayPointer paperNames(new wchar_t[paperCount*64]); - QScopedArrayPointer winSizes(new POINT[paperCount*sizeof(POINT)]); + QScopedArrayPointer winSizes(new POINT[paperCount]); QScopedArrayPointer papers(new wchar_t[paperCount]); // Get the details and match the default paper size @@ -356,7 +356,7 @@ void QWindowsPrintDevice::loadInputSlots() const if (int(binCount) > 0 && DeviceCapabilities(printerId, nullptr, DC_BINNAMES, nullptr, nullptr) == binCount) { - QScopedArrayPointer bins(new WORD[binCount*sizeof(WORD)]); + QScopedArrayPointer bins(new WORD[binCount]); QScopedArrayPointer binNames(new wchar_t[binCount*24]); // Get the details and match the default paper size