From 4769abd741d600196ba1bc8e3377de5abd2697bd Mon Sep 17 00:00:00 2001 From: Jean-Yves Avenard Date: Fri, 12 Aug 2016 20:56:45 +1000 Subject: [PATCH] Bug 1294648: [MSE] Return early if mediasource isn't attached. r=gerald MozReview-Commit-ID: 9hCi5sPbZpW --HG-- extra : rebase_source : 23b4cd16d3e104a30c0f1709b9ce0d04a105d219 --- dom/media/mediasource/MediaSourceDecoder.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dom/media/mediasource/MediaSourceDecoder.cpp b/dom/media/mediasource/MediaSourceDecoder.cpp index 8213adfdfec8..15f07537d408 100644 --- a/dom/media/mediasource/MediaSourceDecoder.cpp +++ b/dom/media/mediasource/MediaSourceDecoder.cpp @@ -114,6 +114,10 @@ MediaSourceDecoder::GetBuffered() { MOZ_ASSERT(NS_IsMainThread()); + if (!mMediaSource) { + NS_WARNING("MediaSource element isn't attached"); + return media::TimeIntervals::Invalid(); + } dom::SourceBufferList* sourceBuffers = mMediaSource->ActiveSourceBuffers(); if (!sourceBuffers) { // Media source object is shutting down.