[USER32] Add ICO_ExtractIconExW RetPtr NULL check (#2149)

CORE-16557
This commit is contained in:
Katayama Hirofumi MZ 2019-12-16 20:37:23 +09:00 committed by GitHub
parent 23147330dd
commit 2af9e7dfac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -469,17 +469,20 @@ static UINT ICO_ExtractIconExW(
icon = CreateIconFromResourceEx(imageData, entry->icHeader.biSizeImage, sig == 1, 0x00030000, cx[index], cy[index], flags);
HeapFree(GetProcessHeap(), 0, cursorData);
if (icon)
{
RetPtr[index] = icon;
iconCount = 1;
}
if (RetPtr)
RetPtr[index] = icon;
else
DestroyIcon(icon);
if(cursorData != NULL)
HeapFree(GetProcessHeap(), 0, cursorData);
iconCount = 1;
break;
}
}
}
}
ret = iconCount; /* return number of retrieved icons */
}