Bug 1207478: P2. Prevent potential division by zero. r=gerald
authorJean-Yves Avenard <jyavenard@mozilla.com>
Wed, 23 Sep 2015 23:17:11 +1000
changeset 264148 016d6f4c79bdcba1303f88d4bce3a48214f6c637
parent 264147 a26e9d557ad48aa4dda26ef0fb36ecd09ed27fd7
child 264149 2ef8751efbba524ff8dab70f81b1462eded482f5
push id65541
push userjyavenard@mozilla.com
push dateThu, 24 Sep 2015 06:43:20 +0000
treeherdermozilla-inbound@8e634cc7b44a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald
bugs1207478
milestone44.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 1207478: P2. Prevent potential division by zero. r=gerald
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)