From 4bb4029b1523aa1dbd328fee6ac66385c5fa5b48 Mon Sep 17 00:00:00 2001 From: Nicolas Pena Date: Thu, 6 Apr 2017 14:28:21 -0400 Subject: Use CFX_MaybeOwned on the buffer of CFX_DIBitmap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ia4181a2838de60e4e177165b3689338c86f45771 Reviewed-on: https://pdfium-review.googlesource.com/3817 Reviewed-by: Tom Sepez Commit-Queue: Nicolás Peña --- core/fxge/win32/fx_win32_dib.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'core/fxge/win32') 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(pData)); m_hMemDC = CreateCompatibleDC(hDC); m_hOldBitmap = (HBITMAP)SelectObject(m_hMemDC, m_hBitmap); } -- cgit v1.2.3