Bug 1530322 - Abort trim if an overflow occurred during earlier time calculation. r=padenot
authorJean-Yves Avenard <jyavenard@mozilla.com>
Tue, 26 Feb 2019 17:32:54 +0000
changeset 519149 e715e094485f8a0f7e9ee926494819a3d20f1980
parent 519148 d16bf53b358583baa538e24697f85a597e4cf41c
child 519150 01c94f24190ae1215e67071cd9ce1bcd6962efa4
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot
bugs1530322
milestone67.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 1530322 - Abort trim if an overflow occurred during earlier time calculation. r=padenot Differential Revision: https://phabricator.services.mozilla.com/D21209
dom/media/MediaData.cpp
--- a/dom/media/MediaData.cpp
+++ b/dom/media/MediaData.cpp
@@ -68,17 +68,18 @@ bool AudioData::AdjustForStartTime(int64
 
 bool AudioData::SetTrimWindow(const media::TimeInterval& aTrim) {
   if (!mAudioData) {
     // MoveableData got called. Can no longer work on it.
     return false;
   }
   const size_t originalFrames = mAudioData.Length() / mChannels;
   const TimeUnit originalDuration = FramesToTimeUnit(originalFrames, mRate);
-  if (aTrim.mStart < mOriginalTime ||
+  if (!aTrim.mStart.IsValid() || !aTrim.mEnd.IsValid() ||
+      aTrim.mStart < mOriginalTime ||
       aTrim.mEnd > mOriginalTime + originalDuration) {
     return false;
   }
 
   auto trimBefore = TimeUnitToFrames(aTrim.mStart - mOriginalTime, mRate);
   auto trimAfter = aTrim.mEnd == GetEndTime()
                        ? originalFrames
                        : TimeUnitToFrames(aTrim.mEnd - mOriginalTime, mRate);