Bug 941892 - Take an early return if nsPluginStreamListenerPeer gets passed an unknown stream. r=bsmedberg

This commit is contained in:
John Schoenick 2013-11-22 13:55:08 -08:00
parent 15d4a0da31
commit 0006952d88

View File

@ -788,9 +788,11 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnDataAvailable(nsIRequest *request,
uint64_t sourceOffset,
uint32_t aLength)
{
NS_ASSERTION(mRequests.IndexOfObject(GetBaseRequest(request)) != -1,
"Received OnDataAvailable for untracked request.");
if (mRequests.IndexOfObject(GetBaseRequest(request)) == -1) {
MOZ_ASSERT(false, "Received OnDataAvailable for untracked request.");
return NS_ERROR_UNEXPECTED;
}
if (mRequestFailed)
return NS_ERROR_FAILURE;