From 13c708b237e8d33af1ea071ba3b878666939b4ad Mon Sep 17 00:00:00 2001 From: Andreas Pehrson Date: Mon, 9 Jan 2017 16:36:00 +0100 Subject: [PATCH] Bug 1329075 - Fix assertion failure in debug build. r=jesup With the attached test case I was failing an assert in a debug build because NotifyMediaTrackEnabled exited early due to `mReadyState == HAVE_NOTHING` but NotifyMediaTrackDisabled didn't. The latter would fail an assert. MozReview-Commit-ID: 7Frpj62s0Bc --HG-- extra : rebase_source : a1dea4f2db564fe28e6eb7f7fcd9c382a46409ac --- dom/html/HTMLMediaElement.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dom/html/HTMLMediaElement.cpp b/dom/html/HTMLMediaElement.cpp index 20b681113651..20403b592b55 100644 --- a/dom/html/HTMLMediaElement.cpp +++ b/dom/html/HTMLMediaElement.cpp @@ -2023,6 +2023,12 @@ void HTMLMediaElement::NotifyMediaTrackDisabled(MediaTrack* aTrack) } } + if (mReadyState == HAVE_NOTHING) { + // No MediaStreamTracks are captured until we have metadata, and code + // below doesn't do anything for captured decoders. + return; + } + for (OutputMediaStream& ms : mOutputStreams) { if (ms.mCapturingDecoder) { MOZ_ASSERT(!ms.mCapturingMediaStream);