Bug 1254721: Ensure consistency between Cenc offsets and sizes table. r=gerald
authorJean-Yves Avenard <jyavenard@mozilla.com>
Tue, 15 Mar 2016 16:34:33 +1100
changeset 288914 f437498da477bac3d8e9852e67c89d6a5c0d7422
parent 288913 1bc37c8758c3c8b2ecc4e2101ad8a44ab3ac4e29
child 288915 5d76f5c65a98ab9b056cb733aadc43e3ab2266f8
push id73613
push userjyavenard@mozilla.com
push dateWed, 16 Mar 2016 05:59:39 +0000
treeherdermozilla-inbound@f437498da477 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald
bugs1254721
milestone48.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 1254721: Ensure consistency between Cenc offsets and sizes table. r=gerald MozReview-Commit-ID: E1KbKIIBR87
media/libstagefright/frameworks/av/media/libstagefright/SampleTable.cpp
--- a/media/libstagefright/frameworks/av/media/libstagefright/SampleTable.cpp
+++ b/media/libstagefright/frameworks/av/media/libstagefright/SampleTable.cpp
@@ -631,18 +631,18 @@ status_t
 SampleTable::parseSampleCencInfo() {
     if ((!mCencDefaultSize && !mCencInfoCount) || mCencOffsets.IsEmpty()) {
         // We don't have all the cenc information we need yet. Quietly fail and
         // hope we get the data we need later in the track header.
         ALOGV("Got half of cenc saio/saiz pair. Deferring parse until we get the other half.");
         return OK;
     }
 
-    if (!mCencSizes.IsEmpty() && mCencOffsets.Length() > 1 &&
-        mCencSizes.IsEmpty() != mCencOffsets.Length()) {
+    if ((mCencOffsets.Length() > 1 && mCencOffsets.Length() < mCencInfoCount) ||
+        (!mCencDefaultSize && mCencSizes.Length() < mCencInfoCount)) {
         return ERROR_MALFORMED;
     }
 
     if (mCencInfoCount > kMAX_ALLOCATION / sizeof(SampleCencInfo)) {
         // Avoid future OOM.
         return ERROR_MALFORMED;
     }