Bug 967357 - Null check MediaResource principal to prevent assertion spam. r=roc
authorChris Pearce <cpearce@mozilla.com>
Wed, 05 Feb 2014 10:34:15 +1300
changeset 166866 a15aa9ce56e20174e700ca47df0553b216e9a70d
parent 166865 2c84be83868929432b43b59eda7d5c56a5b7764c
child 166867 6a25e4cef8da57f6f5cc361b47ffda171c943a64
push id4853
push usercbook@mozilla.com
push dateWed, 05 Feb 2014 13:54:35 +0000
treeherderfx-team@0965914f979c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs967357
milestone30.0a1
Bug 967357 - Null check MediaResource principal to prevent assertion spam. r=roc
content/html/content/src/HTMLMediaElement.cpp
--- a/content/html/content/src/HTMLMediaElement.cpp
+++ b/content/html/content/src/HTMLMediaElement.cpp
@@ -3354,17 +3354,18 @@ already_AddRefed<nsIPrincipal> HTMLMedia
 }
 
 void HTMLMediaElement::NotifyDecoderPrincipalChanged()
 {
   nsRefPtr<nsIPrincipal> principal = GetCurrentPrincipal();
 
   bool subsumes;
   mDecoder->UpdateSameOriginStatus(
-    NS_SUCCEEDED(NodePrincipal()->Subsumes(principal, &subsumes)) && subsumes);
+    !principal ||
+    (NS_SUCCEEDED(NodePrincipal()->Subsumes(principal, &subsumes)) && subsumes));
 
   for (uint32_t i = 0; i < mOutputStreams.Length(); ++i) {
     OutputMediaStream* ms = &mOutputStreams[i];
     ms->mStream->CombineWithPrincipal(principal);
   }
 }
 
 void HTMLMediaElement::UpdateMediaSize(nsIntSize size)