mirror of
https://git.jami.net/savoirfairelinux/jami-daemon.git
synced 2025-08-12 22:09:25 +08:00
windows: fix SIGSEGV occuring when no camera are found
Refs #71985 Change-Id: I78aa51ef823a2d48da96d4f0ed58bc838915b4f5
This commit is contained in:

committed by
Guillaume Roguez

parent
85a890d0e6
commit
42b5e68cf0
@ -105,17 +105,17 @@ VideoDeviceMonitorImpl::run()
|
||||
hr = CoCreateInstance(CLSID_SystemDeviceEnum, NULL,
|
||||
CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&pDevEnum));
|
||||
|
||||
IEnumMoniker *pEnum;
|
||||
IEnumMoniker *pEnum = nullptr;
|
||||
if (SUCCEEDED(hr)) {
|
||||
hr = pDevEnum->CreateClassEnumerator(
|
||||
CLSID_VideoInputDeviceCategory,
|
||||
&pEnum, 0);
|
||||
if (FAILED(hr)) {
|
||||
pDevEnum->Release();
|
||||
if (FAILED(hr) || pEnum == nullptr) {
|
||||
RING_ERR("No webcam found.");
|
||||
hr = VFW_E_NOT_FOUND;
|
||||
}
|
||||
pDevEnum->Release();
|
||||
if (hr != VFW_E_NOT_FOUND) {
|
||||
if (hr != VFW_E_NOT_FOUND && pEnum != nullptr) {
|
||||
IMoniker *pMoniker = NULL;
|
||||
unsigned deviceID = 0;
|
||||
while (pEnum->Next(1, &pMoniker, NULL) == S_OK)
|
||||
|
Reference in New Issue
Block a user