Trying to use Webcam makes the app crash
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
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();tolet 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
Hey, is someone already working on this issue or can I take it? Can you assign this task to me?