Bug 1395244 - check sample_table before using. r?kinetik draft
authorAlfredo.Yang <ayang@mozilla.com>
Tue, 05 Sep 2017 15:19:15 +0800
changeset 658967 55438b5347550020da80f168ec5097603101fdf9
parent 658813 1401e3eec44df87963d3af329ef8a4183ab0483f
child 658968 219adc4f42612b9cbad1750e91d708ca0d21acae
push id77953
push userbmo:ayang@mozilla.com
push dateTue, 05 Sep 2017 07:27:18 +0000
reviewerskinetik
bugs1395244
milestone57.0a1
Bug 1395244 - check sample_table before using. r?kinetik MozReview-Commit-ID: HtIS39UPIIM
media/libstagefright/binding/mp4parse_capi/src/lib.rs
media/libstagefright/binding/update-rust.sh
--- a/media/libstagefright/binding/mp4parse_capi/src/lib.rs
+++ b/media/libstagefright/binding/mp4parse_capi/src/lib.rs
@@ -972,17 +972,17 @@ fn create_sample_table(track: &Track, tr
             _ => return None,
         }
     }
 
     // Correct composition end time due to 'ctts' causes composition time re-ordering.
     //
     // Composition end time is not in specification. However, gecko needs it, so we need to
     // calculate to correct the composition end time.
-    if track.ctts.is_some() {
+    if sample_table.len() > 0 {
         // Create an index table refers to sample_table and sorted by start_composisiton time.
         let mut sort_table = Vec::new();
         sort_table.reserve(sample_table.len());
         for i in 0 .. sample_table.len() {
             sort_table.push(i);
         }
 
         sort_table.sort_by_key(|i| {
--- a/media/libstagefright/binding/update-rust.sh
+++ b/media/libstagefright/binding/update-rust.sh
@@ -1,13 +1,13 @@
 #!/bin/sh -e
 # Script to update mp4parse-rust sources to latest upstream
 
 # Default version.
-VER=81260ded506dce968716720e10544c510f37d222
+VER=18430298d7d48ec8dfa1f80f9a10cc9b5f6cf40a
 
 # Accept version or commit from the command line.
 if test -n "$1"; then
   VER=$1
 fi
 
 echo "Fetching sources..."
 rm -rf _upstream