Bug 1207478 - P2. Prevent potential division by zero. r=gerald, a=sylvestre
authorJean-Yves Avenard <jyavenard@mozilla.com>
Wed, 23 Sep 2015 23:17:11 +1000
changeset 296139 bfa5ce9f77b2be23202fd2e2390cc1cb996bbb21
parent 296138 ae10b93c046541a6681d01fe6c6421f4523001f2
child 296140 2c6a79ea4a1d14d698a4bdeac0a6269aa70a0be3
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald, sylvestre
bugs1207478
milestone43.0a2
Bug 1207478 - P2. Prevent potential division by zero. r=gerald, a=sylvestre
media/libstagefright/binding/MoofParser.cpp
--- a/media/libstagefright/binding/MoofParser.cpp
+++ b/media/libstagefright/binding/MoofParser.cpp
@@ -644,17 +644,19 @@ Mvhd::Mvhd(Box& aBox)
     mTimescale = reader->ReadU32();
     mDuration = reader->ReadU64();
   } else {
     reader->DiscardRemaining();
     return;
   }
   // More stuff that we don't care about
   reader->DiscardRemaining();
-  mValid = true;
+  if (mTimescale) {
+    mValid = true;
+  }
 }
 
 Mdhd::Mdhd(Box& aBox)
   : Mvhd(aBox)
 {
 }
 
 Trex::Trex(Box& aBox)