diff --git a/dom/media/TextTrack.cpp b/dom/media/TextTrack.cpp index 470a8b2a9259..6155e58b3bc2 100644 --- a/dom/media/TextTrack.cpp +++ b/dom/media/TextTrack.cpp @@ -318,6 +318,13 @@ void TextTrack::GetCurrentCuesAndOtherCues( cue->StartTime(), cue->EndTime()); aCurrentCues->AddCue(*cue); } else { + // Negative length cue, which is possible because user can set cue's end + // time arbitrary. + if (cue->EndTime() < cue->StartTime()) { + WEBVTT_LOG("[BAD TIME] skip cue %p [%f:%f] with negative length", + cue, cue->StartTime(), cue->EndTime()); + continue; + } media::TimeInterval cueInterval( media::TimeUnit::FromSeconds(cue->StartTime()), media::TimeUnit::FromSeconds(cue->EndTime())); diff --git a/testing/web-platform/meta/html/semantics/embedded-content/media-elements/track/track-element/track-cues-missed.html.ini b/testing/web-platform/meta/html/semantics/embedded-content/media-elements/track/track-element/track-cues-missed.html.ini deleted file mode 100644 index 545121b12d0b..000000000000 --- a/testing/web-platform/meta/html/semantics/embedded-content/media-elements/track/track-element/track-cues-missed.html.ini +++ /dev/null @@ -1,6 +0,0 @@ -[track-cues-missed.html] - disabled: - if (os == 'win' and processor == 'aarch64'): https://bugzilla.mozilla.org/show_bug.cgi?id=1538303 - [Events are triggered for missed (skipped) cues during normal playback] - expected: FAIL - diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/track-cues-missed.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/track-cues-missed.html index 043c941b123b..2acae212d231 100644 --- a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/track-cues-missed.html +++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/track-cues-missed.html @@ -45,7 +45,7 @@ video.play(); } - function cueEnteredOrExited() { + function cueEnteredOrExited(event) { var currentCue = event.target; assert_equals(testTrack.track.cues.getCueById(cueCount).text, currentCue.text); assert_equals(currentCue.id, cueCount.toString()); @@ -56,4 +56,4 @@ }); - \ No newline at end of file +