Bug 1310162 - mTrack in SimpleTextTrackEvent might be null. r=jwwang
authorbechen <bechen@mozilla.com>
Wed, 28 Dec 2016 15:51:37 +0800
changeset 327600 9060d5b0d39a05c586f5a5818cdbe1ca63c8b65d
parent 327599 f3b87bbe113f275afb1f0f8c2b00a77f04530ddc
child 327601 51131741af7cdb3ca4cc105db578cd4c7af53864
push id35541
push userihsiao@mozilla.com
push dateFri, 30 Dec 2016 14:03:11 +0000
treeherderautoland@9060d5b0d39a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwwang
bugs1310162
milestone53.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 1310162 - mTrack in SimpleTextTrackEvent might be null. r=jwwang MozReview-Commit-ID: ESqYqBem7kQ
dom/html/TextTrackManager.cpp
--- a/dom/html/TextTrackManager.cpp
+++ b/dom/html/TextTrackManager.cpp
@@ -486,21 +486,23 @@ private:
   TextTrack* mTrack;
   RefPtr<TextTrackCue> mCue;
 };
 
 class CompareSimpleTextTrackEvents {
 private:
   int32_t TrackChildPosition(SimpleTextTrackEvent* aEvent) const
   {
-    HTMLTrackElement* trackElement = aEvent->mTrack->GetTrackElement();;
-    if (!trackElement) {
-      return -1;
+    if (aEvent->mTrack) {
+      HTMLTrackElement* trackElement = aEvent->mTrack->GetTrackElement();
+      if (trackElement) {
+        return mMediaElement->IndexOf(trackElement);
+      }
     }
-    return mMediaElement->IndexOf(trackElement);
+    return -1;
   }
   HTMLMediaElement* mMediaElement;
 public:
   explicit CompareSimpleTextTrackEvents(HTMLMediaElement* aMediaElement)
   {
     mMediaElement = aMediaElement;
   }