From 02beb2cc023e1b910b7ba4c6c6bd28f6c2cf142f Mon Sep 17 00:00:00 2001 From: Tobias Weimer Date: Fri, 29 Jan 2016 21:14:52 +0000 Subject: Popup: - Attempt to fix uninitialized memory git-svn-id: http://svn.miranda-ng.org/main/trunk@16189 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Popup/src/bitmap_funcs.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/plugins/Popup/src/bitmap_funcs.cpp b/plugins/Popup/src/bitmap_funcs.cpp index 2ae6256e21..f28dba8f28 100644 --- a/plugins/Popup/src/bitmap_funcs.cpp +++ b/plugins/Popup/src/bitmap_funcs.cpp @@ -762,6 +762,11 @@ void MyBitmap::allocate(int w, int h) width = w; height = h; + if (dcBmp) { + DeleteObject(SelectObject(dcBmp, hBmpSave)); + DeleteDC(dcBmp); + } + BITMAPINFO bi; bi.bmiHeader.biSize = sizeof(bi.bmiHeader); bi.bmiHeader.biWidth = w; @@ -769,11 +774,7 @@ void MyBitmap::allocate(int w, int h) bi.bmiHeader.biPlanes = 1; bi.bmiHeader.biBitCount = 32; bi.bmiHeader.biCompression = BI_RGB; - - if (dcBmp) { - DeleteObject(SelectObject(dcBmp, hBmpSave)); - DeleteDC(dcBmp); - } + bi.bmiColors[0].rgbRed = bi.bmiColors[0].rgbGreen = bi.bmiColors[0].rgbBlue = bi.bmiColors[0].rgbReserved = 0; hBmp = (HBITMAP)CreateDIBSection(0, &bi, DIB_RGB_COLORS, (void **)&bits, 0, 0); dcBmp = CreateCompatibleDC(0); -- cgit v1.2.3