1
0
mirror of https://github.com/clementine-player/Clementine synced 2025-01-19 13:01:32 +01:00

Don't try to create a pixmap from an invalid HICON on Windows. Fixes issue 1417

This commit is contained in:
David Sansome 2011-03-13 22:14:23 +00:00
parent a37bb47e53
commit f37467ac69

View File

@ -175,10 +175,15 @@ WmdmLister::DeviceInfo WmdmLister::ReadDeviceInfo(IWMDMDevice2* device) {
// Get the icon
HICON icon;
device->GetDeviceIcon((ULONG*)&icon);
if (device->GetDeviceIcon((ULONG*)&icon) == S_OK) {
// Extra check for whether the icon is valid (see issue 1417)
ICONINFO iconinfo;
if (GetIconInfo(icon, &iconinfo)) {
ret.icon_ = QPixmap::fromWinHICON(icon);
DestroyIcon(icon);
}
}
// Get the main (first) storage for the device
IWMDMEnumStorage* storage_it = NULL;