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:
parent
a37bb47e53
commit
f37467ac69
@ -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)
|
||||
|
||||
ret.icon_ = QPixmap::fromWinHICON(icon);
|
||||
DestroyIcon(icon);
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user