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)
commitfae3d2f9c1fd13fbb5c7780da9e4ac722ba3d71f
tree76a8e3651dd0caf4c0ffc59e7e6d23897d686f4c
parent545b2acc531563874f04ea82fc6ccc3f3ab64501
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: https://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