Skip to content

Commit

Permalink
libstagefright: check remaining data size before parsing it.
Browse files Browse the repository at this point in the history
Bug: 23248776
Change-Id: I45cf53e58e4375afcf260b122264c968ec0ff6c8
(cherry picked from commit 3bf1e0f)
  • Loading branch information
Wei Jia authored and andi34 committed Jun 7, 2016
1 parent fa16aa6 commit 8ab3245
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions media/libstagefright/id3/ID3.cpp
Expand Up @@ -547,6 +547,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
Expand Down

0 comments on commit 8ab3245

Please sign in to comment.