From ac2a8aa05bea51e3496682242d3bbe5c25901581 Mon Sep 17 00:00:00 2001 From: Tobias Weimer Date: Fri, 29 Jan 2016 20:30:51 +0000 Subject: Core: - Attempt to fix uninitialized memory git-svn-id: http://svn.miranda-ng.org/main/trunk@16188 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/mir_app/src/icolib.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/mir_app') diff --git a/src/mir_app/src/icolib.cpp b/src/mir_app/src/icolib.cpp index e22acb338d..816b9edfd0 100644 --- a/src/mir_app/src/icolib.cpp +++ b/src/mir_app/src/icolib.cpp @@ -232,8 +232,7 @@ int IconSourceItem::getIconData(HICON icon) if (!GetIconInfo(icon, &iconInfo)) return 1; // Failure - int MonoInfoSize, ColorInfoSize; - int MonoBitsSize, ColorBitsSize; + int MonoInfoSize, ColorInfoSize, MonoBitsSize, ColorBitsSize; if (InternalGetDIBSizes(iconInfo.hbmMask, &MonoInfoSize, &MonoBitsSize) || InternalGetDIBSizes(iconInfo.hbmColor, &ColorInfoSize, &ColorBitsSize)) { DeleteObject(iconInfo.hbmColor); @@ -242,10 +241,10 @@ int IconSourceItem::getIconData(HICON icon) } mir_ptr - MonoInfo((BYTE*)mir_alloc(MonoInfoSize)), - MonoBits((BYTE*)mir_alloc(MonoBitsSize)), - ColorInfo((BYTE*)mir_alloc(ColorInfoSize)), - ColorBits((BYTE*)mir_alloc(ColorBitsSize)); + MonoInfo((BYTE*)mir_calloc(MonoInfoSize)), + MonoBits((BYTE*)mir_calloc(MonoBitsSize)), + ColorInfo((BYTE*)mir_calloc(ColorInfoSize)), + ColorBits((BYTE*)mir_calloc(ColorBitsSize)); if (InternalGetDIB(iconInfo.hbmMask, 0, MonoInfo, MonoBits) || InternalGetDIB(iconInfo.hbmColor, 0, ColorInfo, ColorBits)) { -- cgit v1.2.3