Bug 1140933 - Handle empty subsample encryption information in SampleIterator - r=cpearce
authorEdwin Flores <eflores@mozilla.com>
Mon, 09 Mar 2015 13:55:33 +1300
changeset 232481 345adff376f1e79e7f7b81f7a17e207ff76a74b8
parent 232480 8bc13df2c603d26d9d26474a9a62dabbfb22f668
child 232482 dc074235bf94faf53fdf3bb08c40460f83bb9806
push id28384
push usercbook@mozilla.com
push dateMon, 09 Mar 2015 12:46:25 +0000
treeherdermozilla-central@23f1f0369df5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1140933
milestone39.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 1140933 - Handle empty subsample encryption information in SampleIterator - r=cpearce
media/libstagefright/binding/Index.cpp
--- a/media/libstagefright/binding/Index.cpp
+++ b/media/libstagefright/binding/Index.cpp
@@ -141,16 +141,20 @@ MP4Sample* SampleIterator::GetNext()
       if (reader.Remaining() < count * 6) {
         return nullptr;
       }
 
       for (size_t i = 0; i < count; i++) {
         sample->crypto.plain_sizes.AppendElement(reader.ReadU16());
         sample->crypto.encrypted_sizes.AppendElement(reader.ReadU32());
       }
+    } else {
+      // No subsample information means the entire sample is encrypted.
+      sample->crypto.plain_sizes.AppendElement(0);
+      sample->crypto.encrypted_sizes.AppendElement(sample->size);
     }
   }
 
   Next();
 
   return sample.forget();
 }