Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Open
xtfo wants to merge 1 commit intoobsproject:masterfrom
xtfo:fix-virtualcam-createfile-return-check
Open

win-dshow: Fix CreateFileW return value check in virtualcam filter#13134
xtfo wants to merge 1 commit intoobsproject:masterfrom
xtfo:fix-virtualcam-createfile-return-check

Conversation

@xtfo
Copy link
Contributor

@xtfo xtfo commented Feb 17, 2026

Description

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.

Motivation and Context

Fixes bug.

How Has This Been Tested?

Tested the virtual camera.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

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.
@RytoEX RytoEX self-assigned this Feb 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants