VideoCapture crashes on Windows 11 after KB5077181 update (CAP_DSHOW heap corruption, MSMF warnings)

I’m using OpenCV, Windows 11 64-bit, and a Logitech C920 PRO USB camera. OpenCV 4.9.0 from https://opencv.org/releases/. Same behavior with version 4.12.0.

VideoCapture with CAP_DSHOW had been working reliably for several years until Windows installed the 2026-02 Security Update (KB5077181) (26100.7840).

Even before applying this update, there were occasional crashes in
C:\WINDOWS\SYSTEM32\ntdll.dll with a “freeing already freed memory” type of error.

After installing the update, this error now happens regularly:

(38c8.ce0): Access violation - code c0000005 (first chance)
HEAP[java.exe]: HEAP: Free Heap block 000002394A772F10 modified at 000002394A772F48 after it was freed
(38c8.ce0): Break instruction exception - code 80000003 (first chance)
ntdll!RtlpBreakPointHeap+0x16: 00007ffb

I switched from CAP_DSHOW to CAP_MSMF, and the regular crash stopped. However, I now get warnings in the log:

2026-02-12 08:39:15.643 [CameraWorker_video_cam-pos] INFO
c.d.duckserver.camera.CameraWorker -
The source for VideoCapture opens: ‘1’, backendName: ‘MSMF’, captureType: ‘1400’

[ WARN:10@570.361] global cap_msmf.cpp:475
`anonymous-namespace’::SourceReaderCB::OnReadSample
videoio(MSMF): OnReadSample() is called with error status: -1072873821

[ WARN:10@570.361] global cap_msmf.cpp:487
`anonymous-namespace’::SourceReaderCB::OnReadSample
videoio(MSMF): async ReadSample() call is failed with error status: -1072873821

Occasionally, the application also crashes even when using CAP_MSMF.

Has anyone experienced something similar? Any tips or ideas on how to ensure a stable stream?

you should take this to opencv’s issues on github. if you’re lucky, you can find it already resolved among the closed issues (i.e. make sure you can repro the issue on the latest release of opencv). if not… that’s the best place to report such bugs.

1 Like

The following procedure helped. Disconnect all USB cameras. In Device Manager - View - Show hidden devices. Delete Imaging devices of all disconnected cameras. Reconnect the cameras to USB. In the application, set the port indexes (0, 1..) and backend type CAP_DSHOW or CAP_MSMF (or another depending on the camera type).