summaryrefslogtreecommitdiff
path: root/core/fxge/win32
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxge/win32')
-rw-r--r--core/fxge/win32/fx_win32_dib.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/fxge/win32/fx_win32_dib.cpp b/core/fxge/win32/fx_win32_dib.cpp
index f2c47265f7..677fb3ab80 100644
--- a/core/fxge/win32/fx_win32_dib.cpp
+++ b/core/fxge/win32/fx_win32_dib.cpp
@@ -195,8 +195,10 @@ CFX_WindowsDIB::CFX_WindowsDIB(HDC hDC, int width, int height) {
bmih.biHeight = -height;
bmih.biPlanes = 1;
bmih.biWidth = width;
- m_hBitmap = CreateDIBSection(hDC, (BITMAPINFO*)&bmih, DIB_RGB_COLORS,
- (LPVOID*)&m_pBuffer, nullptr, 0);
+ LPVOID pData = nullptr;
+ m_hBitmap = CreateDIBSection(hDC, (BITMAPINFO*)&bmih, DIB_RGB_COLORS, &pData,
+ nullptr, 0);
+ m_pBuffer.Reset(static_cast<uint8_t*>(pData));
m_hMemDC = CreateCompatibleDC(hDC);
m_hOldBitmap = (HBITMAP)SelectObject(m_hMemDC, m_hBitmap);
}