diff options
author | Nick Kralevich <nnk@google.com> | 2015-04-11 00:25:17 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-04-11 00:25:17 +0000 |
commit | 85bb3235ef58120131e20801dd37eb9708ddc570 (patch) | |
tree | d922546ec223bf6442467c9ef9efc6fc7d5646bc | |
parent | 3b042ea54bbaf75bac63bd4d3d7064007b4b0d8d (diff) | |
parent | 8eae9223b61b9290b584dcbe634693964bac4bf8 (diff) | |
download | frameworks_av-85bb3235ef58120131e20801dd37eb9708ddc570.zip frameworks_av-85bb3235ef58120131e20801dd37eb9708ddc570.tar.gz frameworks_av-85bb3235ef58120131e20801dd37eb9708ddc570.tar.bz2 |
am 8eae9223: am a05bd3c1: am 2f47bb53: am eb204f82: am b919a3a3: am 64290793: Merge "Fix integer underflow in ESDS processing" into klp-dev
* commit '8eae9223b61b9290b584dcbe634693964bac4bf8':
Fix integer underflow in ESDS processing
-rw-r--r-- | media/libstagefright/ESDS.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/media/libstagefright/ESDS.cpp b/media/libstagefright/ESDS.cpp index 427bf7b..8fbb57c 100644 --- a/media/libstagefright/ESDS.cpp +++ b/media/libstagefright/ESDS.cpp @@ -136,6 +136,8 @@ status_t ESDS::parseESDescriptor(size_t offset, size_t size) { --size; if (streamDependenceFlag) { + if (size < 2) + return ERROR_MALFORMED; offset += 2; size -= 2; } @@ -145,11 +147,15 @@ status_t ESDS::parseESDescriptor(size_t offset, size_t size) { return ERROR_MALFORMED; } unsigned URLlength = mData[offset]; + if (URLlength >= size) + return ERROR_MALFORMED; offset += URLlength + 1; size -= URLlength + 1; } if (OCRstreamFlag) { + if (size < 2) + return ERROR_MALFORMED; offset += 2; size -= 2; |