From c601df4d5281c9657bbf6772d0cfb65f2035e492 Mon Sep 17 00:00:00 2001 From: Ethan Hugg Date: Tue, 9 Oct 2012 14:03:13 -0700 Subject: [PATCH] Bug 791270 - Protect AddStream from NULL input and cause a JS error to be thrown r=jesup --- .../signaling/src/peerconnection/PeerConnectionImpl.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp index 0b38caf3a9fa..59550b340e34 100644 --- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp +++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp @@ -723,7 +723,10 @@ PeerConnectionImpl::SetRemoteDescription(int32_t action, const char* aSDP) { NS_IMETHODIMP PeerConnectionImpl::AddStream(nsIDOMMediaStream* aMediaStream) { - MOZ_ASSERT(aMediaStream); + if (!aMediaStream) { + CSFLogError(logTag, "%s - aMediaStream is NULL", __FUNCTION__); + return NS_ERROR_FAILURE; + } nsDOMMediaStream* stream = static_cast(aMediaStream);