mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-29 16:26:39 +01:00
Global (Windows): fixes possible use-before-init errors
This commit is contained in:
@@ -72,13 +72,13 @@ extern "C" const char* ffDetectCamera(FF_A_UNUSED FFlist* result) {
|
||||
continue;
|
||||
}
|
||||
|
||||
IMFStreamDescriptor* FF_AUTO_RELEASE_COM_OBJECT sd = NULL;
|
||||
IMFStreamDescriptor* FF_AUTO_RELEASE_COM_OBJECT sd = nullptr;
|
||||
BOOL selected;
|
||||
if (FAILED(pd->GetStreamDescriptorByIndex(0, &selected, &sd))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
IMFMediaTypeHandler* FF_AUTO_RELEASE_COM_OBJECT handler = NULL;
|
||||
IMFMediaTypeHandler* FF_AUTO_RELEASE_COM_OBJECT handler = nullptr;
|
||||
if (FAILED(sd->GetMediaTypeHandler(&handler))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ static const char* detectSoundDevice(FFlist* devices /* List of FFSoundDevice */
|
||||
return "immDevice->GetId() failed";
|
||||
}
|
||||
|
||||
IPropertyStore* FF_AUTO_RELEASE_COM_OBJECT immPropStore;
|
||||
IPropertyStore* FF_AUTO_RELEASE_COM_OBJECT immPropStore = NULL;
|
||||
if (FAILED(immDevice->OpenPropertyStore(STGM_READ, &immPropStore))) {
|
||||
return "immDevice->OpenPropertyStore() failed";
|
||||
}
|
||||
@@ -54,7 +54,7 @@ static const char* detectSoundDevice(FFlist* devices /* List of FFSoundDevice */
|
||||
}
|
||||
}
|
||||
|
||||
IAudioEndpointVolume* FF_AUTO_RELEASE_COM_OBJECT immEndpointVolume;
|
||||
IAudioEndpointVolume* FF_AUTO_RELEASE_COM_OBJECT immEndpointVolume = NULL;
|
||||
if (SUCCEEDED(immDevice->Activate(IID_IAudioEndpointVolume, CLSCTX_ALL, NULL, (void**) &immEndpointVolume))) {
|
||||
BOOL muted;
|
||||
if (FAILED(immEndpointVolume->GetMute(&muted)) || !muted) {
|
||||
|
||||
Reference in New Issue
Block a user