From 30d18e814fdce251b388af8a67c905f167359c55 Mon Sep 17 00:00:00 2001 From: Matthew Gregan Date: Tue, 5 May 2009 18:13:26 +1200 Subject: [PATCH] Bug 489830 - Make MediaListener's mNextListener assertion a non-fatal error to avoid crashing in the face of a listener that breaks nsIRequest's contract. r+sr=roc --HG-- extra : rebase_source : d88fd679bbb532193782f75a8e0cbdff43e602f2 --- content/html/content/src/nsHTMLMediaElement.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/content/html/content/src/nsHTMLMediaElement.cpp b/content/html/content/src/nsHTMLMediaElement.cpp index 6a0583ed1a06..3789d9882eb3 100644 --- a/content/html/content/src/nsHTMLMediaElement.cpp +++ b/content/html/content/src/nsHTMLMediaElement.cpp @@ -245,7 +245,10 @@ NS_IMETHODIMP nsHTMLMediaElement::MediaLoadListener::OnDataAvailable(nsIRequest* nsIInputStream* aStream, PRUint32 aOffset, PRUint32 aCount) { - NS_ABORT_IF_FALSE(mNextListener, "Must have a listener"); + if (!mNextListener) { + NS_ERROR("Must have a chained listener; OnStartRequest should have canceled this request"); + return NS_BINDING_ABORTED; + } return mNextListener->OnDataAvailable(aRequest, aContext, aStream, aOffset, aCount); }