diff options
author | Wei Jia <wjia@google.com> | 2015-08-16 17:41:50 -0700 |
---|---|---|
committer | Wei Jia <wjia@google.com> | 2015-08-16 17:41:50 -0700 |
commit | 3bf1e0fdf27e1188b8d3574ed073595b8eacb114 (patch) | |
tree | f6bd74544d3c09fd7047275b348d8a9095fbe47b /media/libstagefright/id3 | |
parent | 4883125b0df72ee404de8b244c3e6511f62947ee (diff) | |
download | frameworks_av-3bf1e0fdf27e1188b8d3574ed073595b8eacb114.zip frameworks_av-3bf1e0fdf27e1188b8d3574ed073595b8eacb114.tar.gz frameworks_av-3bf1e0fdf27e1188b8d3574ed073595b8eacb114.tar.bz2 |
libstagefright: check remaining data size before parsing it.
Bug: 23248776
Change-Id: I45cf53e58e4375afcf260b122264c968ec0ff6c8
Diffstat (limited to 'media/libstagefright/id3')
-rw-r--r-- | media/libstagefright/id3/ID3.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/media/libstagefright/id3/ID3.cpp b/media/libstagefright/id3/ID3.cpp index a90d958..29bc9e0 100644 --- a/media/libstagefright/id3/ID3.cpp +++ b/media/libstagefright/id3/ID3.cpp @@ -509,6 +509,9 @@ void ID3::Iterator::getstring(String8 *id, bool otherdata) const { return; } + if (mFrameSize < getHeaderLength() + 1) { + return; + } size_t n = mFrameSize - getHeaderLength() - 1; if (otherdata) { // skip past the encoding, language, and the 0 separator |