summaryrefslogtreecommitdiff
path: root/core/fxge/win32
diff options
context:
space:
mode:
authorNicolas Pena <npm@chromium.org>2017-04-06 14:28:21 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-04-07 01:03:11 +0000
commit4bb4029b1523aa1dbd328fee6ac66385c5fa5b48 (patch)
tree4084730f50784fcc6787401099dcbbcf6ea3e8b7 /core/fxge/win32
parent2b797295d6851b3189bcb38c5994074f36453865 (diff)
downloadpdfium-4bb4029b1523aa1dbd328fee6ac66385c5fa5b48.tar.xz
Use CFX_MaybeOwned on the buffer of CFX_DIBitmap
Change-Id: Ia4181a2838de60e4e177165b3689338c86f45771 Reviewed-on: https://pdfium-review.googlesource.com/3817 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
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);
}