mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-05-24 00:06:22 -04:00
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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user