Accessing localDescription, remoteDescription, etc. after setTimeout raises EXC_BAD_A...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 12 Jul 2017 22:31:45 +0000 (22:31 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 12 Jul 2017 22:31:45 +0000 (22:31 +0000)
commit7d0301e3a25a3ebc7c9368686bd202b4000a037b
tree98398e5b1a77bfcc8b1f860e52c66cdeaa3cf056
parent6887dba4e37f0b6e30cd36ea5de26fdb3412f5a1
Accessing localDescription, remoteDescription, etc. after setTimeout raises EXC_BAD_ACCESS
https://bugs.webkit.org/show_bug.cgi?id=174323
<rdar://problem/33267876>

Patch by Youenn Fablet <youenn@apple.com> on 2017-07-12
Reviewed by Eric Carlson.

Test: webrtc/calling-peerconnection-once-closed.html

In case the libwebrtc backend is null, we should not use it to get description from it.
Return null in that case.

Adding ASSERT to other calls where the layer above LibWebRTCMediaEndpoint should protect
from calling a function on a null libwebrtc backend.

* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::currentLocalDescription):
(WebCore::LibWebRTCMediaEndpoint::currentRemoteDescription):
(WebCore::LibWebRTCMediaEndpoint::pendingLocalDescription):
(WebCore::LibWebRTCMediaEndpoint::pendingRemoteDescription):
(WebCore::LibWebRTCMediaEndpoint::localDescription):
(WebCore::LibWebRTCMediaEndpoint::remoteDescription):
(WebCore::LibWebRTCMediaEndpoint::doSetLocalDescription):
(WebCore::LibWebRTCMediaEndpoint::doSetRemoteDescription):
(WebCore::LibWebRTCMediaEndpoint::addTrack):
(WebCore::LibWebRTCMediaEndpoint::removeTrack):
(WebCore::LibWebRTCMediaEndpoint::doCreateOffer):
(WebCore::LibWebRTCMediaEndpoint::doCreateAnswer):
(WebCore::LibWebRTCMediaEndpoint::createDataChannel):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219428 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/webrtc/calling-peerconnection-once-closed-expected.txt [new file with mode: 0644]
LayoutTests/webrtc/calling-peerconnection-once-closed.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp