win-dshow: Fix CreateFileW return value check in virtualcam filter

CreateFileW returns INVALID_HANDLE_VALUE on failure, not NULL.
The previous check would always evaluate to true on failure,
causing ReadFile and CloseHandle to be called on an invalid
handle.
This commit is contained in:
tfo
2026-02-17 22:14:55 +01:00
committed by Ryan Foster
parent fdca38a63e
commit 17fc299b74

View File

@@ -61,7 +61,7 @@ VCamFilter::VCamFilter() : OutputFilter()
StringCbCat(res_file, sizeof(res_file), L"\\obs-virtualcam.txt");
HANDLE file = CreateFileW(res_file, GENERIC_READ, 0, nullptr, OPEN_EXISTING, 0, nullptr);
if (file) {
if (file != INVALID_HANDLE_VALUE) {
char res[128];
DWORD len = 0;