blob: 014bc9e8c79aa23f6b83a611ff0ea27bfd4c34b6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
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
Differential Revision: https://phabricator.services.mozilla.com/D110589
---
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;
}
|