Title: [273265] trunk/Source/WebKit
Revision
273265
Author
[email protected]
Date
2021-02-22 11:44:49 -0800 (Mon, 22 Feb 2021)

Log Message

UserMediaPermissionRequestManagerProxy may be released while computing capture device list
https://bugs.webkit.org/show_bug.cgi?id=222236
<rdar://74480265>

Reviewed by Youenn Fablet.

* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::computeFilteredDeviceList): Return early
if `weakThis` is NULL.

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (273264 => 273265)


--- trunk/Source/WebKit/ChangeLog	2021-02-22 19:12:03 UTC (rev 273264)
+++ trunk/Source/WebKit/ChangeLog	2021-02-22 19:44:49 UTC (rev 273265)
@@ -1,3 +1,15 @@
+2021-02-22  Eric Carlson  <[email protected]>
+
+        UserMediaPermissionRequestManagerProxy may be released while computing capture device list
+        https://bugs.webkit.org/show_bug.cgi?id=222236
+        <rdar://74480265>
+
+        Reviewed by Youenn Fablet.
+
+        * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
+        (WebKit::UserMediaPermissionRequestManagerProxy::computeFilteredDeviceList): Return early
+        if `weakThis` is NULL.
+
 2021-02-22  Carlos Garcia Campos  <[email protected]>
 
         [SOUP] Add support for libsoup3

Modified: trunk/Source/WebKit/UIProcess/UserMediaPermissionRequestManagerProxy.cpp (273264 => 273265)


--- trunk/Source/WebKit/UIProcess/UserMediaPermissionRequestManagerProxy.cpp	2021-02-22 19:12:03 UTC (rev 273264)
+++ trunk/Source/WebKit/UIProcess/UserMediaPermissionRequestManagerProxy.cpp	2021-02-22 19:44:49 UTC (rev 273265)
@@ -710,6 +710,10 @@
     static const unsigned defaultMaximumMicrophoneCount = 1;
 
     platformGetMediaStreamDevices([this, weakThis = makeWeakPtr(this), revealIdsAndLabels, completion = WTFMove(completion)](auto&& devices) mutable {
+
+        if (!weakThis)
+            completion({ });
+
         unsigned cameraCount = 0;
         unsigned microphoneCount = 0;
 
@@ -734,10 +738,9 @@
             filteredDevices.append(revealIdsAndLabels ? device : CaptureDevice({ }, device.type(), { }, { }));
         }
 
-        if (weakThis)
-            m_hasFilteredDeviceList = !revealIdsAndLabels;
+        weakThis->m_hasFilteredDeviceList = !revealIdsAndLabels;
+        ALWAYS_LOG(LOGIDENTIFIER, filteredDevices.size(), " devices revealed");
 
-        ALWAYS_LOG(LOGIDENTIFIER, filteredDevices.size(), " devices revealed");
         completion(WTFMove(filteredDevices));
     });
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to