mirror of
https://github.com/clementine-player/Clementine
synced 2025-01-31 19:45:31 +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
|
// Get the icon
|
||||||
HICON 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);
|
ICONINFO iconinfo;
|
||||||
DestroyIcon(icon);
|
if (GetIconInfo(icon, &iconinfo)) {
|
||||||
|
ret.icon_ = QPixmap::fromWinHICON(icon);
|
||||||
|
DestroyIcon(icon);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Get the main (first) storage for the device
|
// Get the main (first) storage for the device
|
||||||
IWMDMEnumStorage* storage_it = NULL;
|
IWMDMEnumStorage* storage_it = NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user