diff options
author | Lajos Molnar <lajos@google.com> | 2014-03-21 19:20:27 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-03-21 19:20:27 +0000 |
commit | 3089021031d6ad0f2b330567f108aec03fa13994 (patch) | |
tree | 88c9f6f52c0d82a1182c72caa72171544eed435a | |
parent | 1bfb8f762dd21b39756fd8fd9990172cae1cef79 (diff) | |
parent | 333ceb4f66ccf790081026f645474e07d832fbdb (diff) | |
download | frameworks_av-3089021031d6ad0f2b330567f108aec03fa13994.zip frameworks_av-3089021031d6ad0f2b330567f108aec03fa13994.tar.gz frameworks_av-3089021031d6ad0f2b330567f108aec03fa13994.tar.bz2 |
am 333ceb4f: Merge "DO NOT MERGE: PlaylistFetcher: fix infinite loop when parsing ADTS." into klp-dev
* commit '333ceb4f66ccf790081026f645474e07d832fbdb':
DO NOT MERGE: PlaylistFetcher: fix infinite loop when parsing ADTS.
-rw-r--r-- | media/libstagefright/httplive/PlaylistFetcher.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/media/libstagefright/httplive/PlaylistFetcher.cpp b/media/libstagefright/httplive/PlaylistFetcher.cpp index ada856d..668cbd4 100644 --- a/media/libstagefright/httplive/PlaylistFetcher.cpp +++ b/media/libstagefright/httplive/PlaylistFetcher.cpp @@ -1321,6 +1321,18 @@ status_t PlaylistFetcher::extractAndQueueAccessUnits( | (adtsHeader[4] << 3) | (adtsHeader[5] >> 5); + if (aac_frame_length == 0) { + const uint8_t *id3Header = adtsHeader; + if (!memcmp(id3Header, "ID3", 3)) { + ID3 id3(id3Header, buffer->size() - offset, true); + if (id3.isValid()) { + offset += id3.rawSize(); + continue; + }; + } + return ERROR_MALFORMED; + } + CHECK_LE(offset + aac_frame_length, buffer->size()); sp<ABuffer> unit = new ABuffer(aac_frame_length); |