Memory leak caused by PeerConnection add a NULL media stream
authortommyw@google.com <tommyw@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Jan 2012 20:25:15 +0000 (20:25 +0000)
committertommyw@google.com <tommyw@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Jan 2012 20:25:15 +0000 (20:25 +0000)
commit42a4e50d390e7e156166b0fc02ddfc4f0944c5b1
tree76a8e3651dd0caf4c0ffc59e7e6d23897d686f4c
parentf80d5dae7a3780e4e665e74a880e9e1816204b45
Memory leak caused by PeerConnection add a NULL media stream
https://bugs.webkit.org/show_bug.cgi?id=76150

Source/WebCore:

It was my missunderstanding that the IDL keyword [StrictTypeChecking] also protects against
null or undefined arguments, it doesn't. Added checks for null pointers.

Reviewed by Adam Barth.

Test: fast/mediastream/peerconnection-addstream.html

* mediastream/PeerConnection.cpp:
(WebCore::PeerConnection::addStream):
(WebCore::PeerConnection::removeStream):

LayoutTests:

Added a basic LayoutTest for null/undefined arguments to PeerConnection::addStream().

Reviewed by Adam Barth.

* fast/mediastream/peerconnection-addstream-expected.txt: Added.
* fast/mediastream/peerconnection-addstream.html: Added.
* fast/mediastream/script-tests/peerconnection-addstream.js: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106275 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/mediastream/peerconnection-addstream-expected.txt [new file with mode: 0644]
LayoutTests/fast/mediastream/peerconnection-addstream.html [new file with mode: 0644]
LayoutTests/fast/mediastream/script-tests/peerconnection-addstream.js [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/mediastream/PeerConnection.cpp