diff options
author | Tobias Weimer <wishmaster51@googlemail.com> | 2016-01-29 21:14:52 +0000 |
---|---|---|
committer | Tobias Weimer <wishmaster51@googlemail.com> | 2016-01-29 21:14:52 +0000 |
commit | 02beb2cc023e1b910b7ba4c6c6bd28f6c2cf142f (patch) | |
tree | d82efd850371692ea23003a00c58f1ed901b16b1 /plugins/Popup | |
parent | ac2a8aa05bea51e3496682242d3bbe5c25901581 (diff) |
Popup:
- Attempt to fix uninitialized memory
git-svn-id: http://svn.miranda-ng.org/main/trunk@16189 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Popup')
-rw-r--r-- | plugins/Popup/src/bitmap_funcs.cpp | 11 |
1 files 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);
|