Title: [214262] trunk/Source/WebCore
Revision
214262
Author
commit-qu...@webkit.org
Date
2017-03-22 11:00:22 -0700 (Wed, 22 Mar 2017)

Log Message

RTCPeerConnection is crashing if no backend is created
https://bugs.webkit.org/show_bug.cgi?id=169938

Patch by Youenn Fablet <you...@apple.com> on 2017-03-22
Reviewed by Geoffrey Garen.

RTCPeerConnection should not be visible if it is not able to create a backend.
In case when this happens anyway, it should be able to be stopped and destroyed without crashing.
To do so, we need to set its state to closed.

* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::RTCPeerConnection):
(WebCore::RTCPeerConnection::close): Cosmetic change, just in case stop becomes reentrant at some point.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (214261 => 214262)


--- trunk/Source/WebCore/ChangeLog	2017-03-22 17:56:29 UTC (rev 214261)
+++ trunk/Source/WebCore/ChangeLog	2017-03-22 18:00:22 UTC (rev 214262)
@@ -1,3 +1,18 @@
+2017-03-22  Youenn Fablet  <you...@apple.com>
+
+        RTCPeerConnection is crashing if no backend is created
+        https://bugs.webkit.org/show_bug.cgi?id=169938
+
+        Reviewed by Geoffrey Garen.
+
+        RTCPeerConnection should not be visible if it is not able to create a backend.
+        In case when this happens anyway, it should be able to be stopped and destroyed without crashing.
+        To do so, we need to set its state to closed.
+
+        * Modules/mediastream/RTCPeerConnection.cpp:
+        (WebCore::RTCPeerConnection::RTCPeerConnection):
+        (WebCore::RTCPeerConnection::close): Cosmetic change, just in case stop becomes reentrant at some point.
+
 2017-03-22  Antoine Quint  <grao...@webkit.org>
 
         [Modern Media Controls] Rendering glitches for fullscreen controls while dragging

Modified: trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp (214261 => 214262)


--- trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp	2017-03-22 17:56:29 UTC (rev 214261)
+++ trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp	2017-03-22 18:00:22 UTC (rev 214262)
@@ -76,6 +76,10 @@
     : ActiveDOMObject(&context)
     , m_backend(PeerConnectionBackend::create(*this))
 {
+    if (!m_backend) {
+        m_signalingState = RTCSignalingState::Closed;
+        m_iceConnectionState = RTCIceConnectionState::Closed;
+    }
 }
 
 RTCPeerConnection::~RTCPeerConnection()
@@ -354,11 +358,11 @@
     if (m_signalingState == RTCSignalingState::Closed)
         return;
 
-    m_backend->stop();
-
     m_iceConnectionState = RTCIceConnectionState::Closed;
     m_signalingState = RTCSignalingState::Closed;
 
+    m_backend->stop();
+
     for (RTCRtpSender& sender : m_transceiverSet->senders())
         sender.stop();
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to