From c2467e583e0d638d1ede5fe88f1a2bfd73f303ee Mon Sep 17 00:00:00 2001 From: Jean-Yves Avenard Date: Tue, 15 Mar 2016 16:34:33 +1100 Subject: [PATCH] Bug 1254721: Ensure consistency between Cenc offsets and sizes table. r=gerald MozReview-Commit-ID: E1KbKIIBR87 --- .../frameworks/av/media/libstagefright/SampleTable.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/media/libstagefright/frameworks/av/media/libstagefright/SampleTable.cpp b/media/libstagefright/frameworks/av/media/libstagefright/SampleTable.cpp index 9abc18618808..923b3588d5e2 100644 --- a/media/libstagefright/frameworks/av/media/libstagefright/SampleTable.cpp +++ b/media/libstagefright/frameworks/av/media/libstagefright/SampleTable.cpp @@ -636,8 +636,8 @@ SampleTable::parseSampleCencInfo() { 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; }