Commit 2006424e authored by ValdikSS ValdikSS's avatar ValdikSS ValdikSS
Browse files

Prevent null pointer dereference if there's no audio devices

BUG: 454917
parent dcf41545
Pipeline #233994 passed with stage
in 5 minutes and 28 seconds
......@@ -252,9 +252,19 @@ bool SystemvolumePlugin::sendSinkList()
unsigned int deviceCount;
devices->GetCount(&deviceCount);
if (!deviceCount) {
qWarning("No audio devices detected");
return false;
}
IMMDevice *defaultDevice = nullptr;
deviceEnumerator->GetDefaultAudioEndpoint(eRender, eMultimedia, &defaultDevice);
if (!defaultDevice) {
qWarning("No default audio device detected");
return false;
}
LPWSTR defaultId = NULL;
defaultDevice->GetId(&defaultId);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment