Source code

Revision control

Copy as Markdown

Other Tools

From: Jan-Ivar Bruaroey <jib@mozilla.com>
Date: Fri, 18 Aug 2023 13:26:37 -0500
Subject: Bug 1701809: Close dev/video* driver file descriptors after camera
access on linux. r=ng
---
modules/video_capture/linux/device_info_v4l2.cc | 1 +
1 file changed, 1 insertion(+)
diff --git a/modules/video_capture/linux/device_info_v4l2.cc b/modules/video_capture/linux/device_info_v4l2.cc
index cd0ba6e3df..c5d33ff9a4 100644
--- a/modules/video_capture/linux/device_info_v4l2.cc
+++ b/modules/video_capture/linux/device_info_v4l2.cc
@@ -330,6 +330,7 @@ int32_t DeviceInfoV4l2::CreateCapabilityMap(const char* deviceUniqueIdUTF8) {
if (ioctl(fd, VIDIOC_QUERYCAP, &cap) == 0) {
// skip devices without video capture capability
if (!IsVideoCaptureDevice(&cap)) {
+ close(fd);
continue;
}