diff options
author | Abhishek Arya <aarya@google.com> | 2015-08-20 01:16:21 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-08-20 01:16:21 +0000 |
commit | 75f6043574256313de760628806df441566fd114 (patch) | |
tree | d21b6948a188f9c0334f61869b96878289d36fc5 /media/libstagefright/MPEG4Extractor.cpp | |
parent | 0742dd1d9a6fab54c6f71ea7d44deb24d291adaa (diff) | |
parent | 527ad688e8d1e89d903351c5fbf39514da52adbe (diff) | |
download | frameworks_av-75f6043574256313de760628806df441566fd114.zip frameworks_av-75f6043574256313de760628806df441566fd114.tar.gz frameworks_av-75f6043574256313de760628806df441566fd114.tar.bz2 |
am 527ad688: am 8a83ce9c: am 54ea6c02: am 5ff4bb7a: am 8026ad38: am 6efa86be: Merge "Check vector size before accessing" into klp-dev
* commit '527ad688e8d1e89d903351c5fbf39514da52adbe':
Check vector size before accessing
Diffstat (limited to 'media/libstagefright/MPEG4Extractor.cpp')
-rw-r--r-- | media/libstagefright/MPEG4Extractor.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/media/libstagefright/MPEG4Extractor.cpp b/media/libstagefright/MPEG4Extractor.cpp index 4482b6c..2714348 100644 --- a/media/libstagefright/MPEG4Extractor.cpp +++ b/media/libstagefright/MPEG4Extractor.cpp @@ -3368,8 +3368,17 @@ status_t MPEG4Source::parseSampleAuxiliaryInformationOffsets( int ivlength; CHECK(mFormat->findInt32(kKeyCryptoDefaultIVSize, &ivlength)); + // only 0, 8 and 16 byte initialization vectors are supported + if (ivlength != 0 && ivlength != 8 && ivlength != 16) { + ALOGW("unsupported IV length: %d", ivlength); + return ERROR_MALFORMED; + } // read CencSampleAuxiliaryDataFormats for (size_t i = 0; i < mCurrentSampleInfoCount; i++) { + if (i >= mCurrentSamples.size()) { + ALOGW("too few samples"); + break; + } Sample *smpl = &mCurrentSamples.editItemAt(i); memset(smpl->iv, 0, 16); |