Cap icon indicating copy to clipboard operation
Cap copied to clipboard

Trying to use Webcam makes the app crash

Open najibbom opened this issue 3 months ago • 3 comments

Description

The app crashes when i activate my webcam

Reproduction

Just change webcam input from no camera to anything else

Additional Context

  • Cap version: 0.3.82
  • Operating system, version: Windows 11
  • Device: RTX 3070 GPU

https://github.com/user-attachments/assets/f07a5bab-5412-4544-99c3-77b5126f929d

najibbom avatar Nov 05 '25 13:11 najibbom

CAP-539

linear[bot] avatar Nov 05 '25 13:11 linear[bot]

A summary of the changes CodeRabbit can apply:

  • Replace the panicking unwrap() with guarded error handling to skip faulty frames and prevent Media Foundation webcam crashes (modify crates/camera-windows/src/lib.rs—line 89) and add documentation (create WEBCAM_CRASH_FIX.md).

  • Fix webcam crash by replacing an unwrap panic in crates/camera-windows/src/lib.rs (change let len = unsafe { sample.GetBufferCount() }.unwrap(); to let Ok(len) = (unsafe { sample.GetBufferCount() }) else { return; };) and add a new WEBCAM_CRASH_FIX.md document describing the issue, root cause, fix, testing, impact, and prevention.

  • [ ] ✅ Create PR with these edits
  • [ ] 📋 Get copyable edits

coderabbitai[bot] avatar Nov 05 '25 13:11 coderabbitai[bot]

Hey, is someone already working on this issue or can I take it? Can you assign this task to me?

VaideshWaranR avatar Nov 05 '25 18:11 VaideshWaranR