Bug 1126723 - Don't store bogus durations. r=cpearce, a=sledru
authorBobby Holley <bobbyholley@gmail.com>
Wed, 11 Feb 2015 18:33:24 -0800
changeset 243783 4f90bd0f1348
parent 243782 ad8bd14634dd
child 243784 bbd9460d9987
push id4478
push userryanvm@gmail.com
push date2015-02-17 14:44 +0000
treeherdermozilla-beta@8597521cb8bd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce, sledru
bugs1126723
milestone36.0
Bug 1126723 - Don't store bogus durations. r=cpearce, a=sledru The apple MP3 decoder passes in garbage for this particular live stream. Let's validate our inputs.
dom/media/MediaDecoderStateMachine.cpp
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -1432,17 +1432,17 @@ int64_t MediaDecoderStateMachine::GetEnd
 }
 
 void MediaDecoderStateMachine::SetDuration(int64_t aDuration)
 {
   NS_ASSERTION(NS_IsMainThread() || OnDecodeThread(),
                "Should be on main or decode thread.");
   AssertCurrentThreadInMonitor();
 
-  if (aDuration == -1) {
+  if (aDuration < 0) {
     mDurationSet = false;
     return;
   }
 
   mDurationSet = true;
 
   if (mStartTime == -1) {
     SetStartTime(0);