From 1dd04884d754427723377a2fed5b58e5ebb6d3b2 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Thu, 1 May 2014 17:19:54 +0200 Subject: [PATCH] comctl32/imagelist: Correctly resize the alpha flags when clearing the image list. --- dlls/comctl32/imagelist.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlls/comctl32/imagelist.c b/dlls/comctl32/imagelist.c index eedf7c55121..dfdb46a2e42 100644 --- a/dlls/comctl32/imagelist.c +++ b/dlls/comctl32/imagelist.c @@ -2376,6 +2376,12 @@ ImageList_Remove (HIMAGELIST himl, INT i) for (nCount = 0; nCount < MAX_OVERLAYIMAGE; nCount++) himl->nOvlIdx[nCount] = -1; + if (himl->has_alpha) + { + HeapFree( GetProcessHeap(), 0, himl->has_alpha ); + himl->has_alpha = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, himl->cMaxImage ); + } + hbmNewImage = ImageList_CreateImage(himl->hdcImage, himl, himl->cMaxImage); SelectObject (himl->hdcImage, hbmNewImage); DeleteObject (himl->hbmImage);