Bug 1411504. P8 - return an error for RecreateChannel() when the decoder is shutting down. r=gerald
authorJW Wang <jwwang@mozilla.com>
Wed, 25 Oct 2017 09:45:14 +0800
changeset 388657 d7f7d7cb6a4bd1cd76ce6929944e4eb952de0bbb
parent 388656 b72ec18b1413a74a7054df6386062f9c6619dde6
child 388658 6aad967c91d9b39556e957024622004d314b5f30
push id96678
push userarchaeopteryx@coole-files.de
push dateFri, 27 Oct 2017 10:02:49 +0000
treeherdermozilla-inbound@b4fcd38ea40f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald
bugs1411504
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1411504. P8 - return an error for RecreateChannel() when the decoder is shutting down. r=gerald Otherwise Seek() will continue to call OpenChannel() and hit null-deref for mChannel is null. MozReview-Commit-ID: 4nhbF9lUOSR
dom/media/ChannelMediaResource.cpp
--- a/dom/media/ChannelMediaResource.cpp
+++ b/dom/media/ChannelMediaResource.cpp
@@ -739,22 +739,22 @@ ChannelMediaResource::RecreateChannel()
   nsLoadFlags loadFlags =
     nsICachingChannel::LOAD_BYPASS_LOCAL_CACHE_IF_BUSY |
     nsIChannel::LOAD_CLASSIFY_URI |
     (mLoadInBackground ? nsIRequest::LOAD_BACKGROUND : 0);
 
   MediaDecoderOwner* owner = mCallback->GetMediaOwner();
   if (!owner) {
     // The decoder is being shut down, so don't bother opening a new channel
-    return NS_OK;
+    return NS_ERROR_ABORT;
   }
   dom::HTMLMediaElement* element = owner->GetMediaElement();
   if (!element) {
     // The decoder is being shut down, so don't bother opening a new channel
-    return NS_OK;
+    return NS_ERROR_ABORT;
   }
   nsCOMPtr<nsILoadGroup> loadGroup = element->GetDocumentLoadGroup();
   NS_ENSURE_TRUE(loadGroup, NS_ERROR_NULL_POINTER);
 
   nsSecurityFlags securityFlags = element->ShouldCheckAllowOrigin()
                                   ? nsILoadInfo::SEC_REQUIRE_CORS_DATA_INHERITS
                                   : nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_INHERITS;