diff options
author | Marco Nelissen <marcone@google.com> | 2015-08-07 15:01:52 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-08-07 15:01:52 +0000 |
commit | 48192b84db39879e7d83a2f4e7023048fb81ee8e (patch) | |
tree | da2e27ff472d39842ee796d3523785036acd6d42 /media/libstagefright/id3 | |
parent | 9ac30bd4a43e025ce27c0a78bbe2ac05a66bcbda (diff) | |
parent | 0625841daae5bb1351034909ce705aab517eea2d (diff) | |
download | frameworks_av-48192b84db39879e7d83a2f4e7023048fb81ee8e.zip frameworks_av-48192b84db39879e7d83a2f4e7023048fb81ee8e.tar.gz frameworks_av-48192b84db39879e7d83a2f4e7023048fb81ee8e.tar.bz2 |
am 0625841d: am dfaea255: am 578d5b66: am 171b5fad: am d6ea7f65: am f26400c9: Fix crash on malformed id3
* commit '0625841daae5bb1351034909ce705aab517eea2d':
Fix crash on malformed id3
Diffstat (limited to 'media/libstagefright/id3')
-rw-r--r-- | media/libstagefright/id3/ID3.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/media/libstagefright/id3/ID3.cpp b/media/libstagefright/id3/ID3.cpp index d9491d6..38ba844 100644 --- a/media/libstagefright/id3/ID3.cpp +++ b/media/libstagefright/id3/ID3.cpp @@ -811,6 +811,12 @@ ID3::getAlbumArt(size_t *length, String8 *mime) const { size_t descLen = StringSize(&data[2 + mimeLen], encoding); + if (size < 2 || + size - 2 < mimeLen || + size - 2 - mimeLen < descLen) { + ALOGW("bogus album art sizes"); + return NULL; + } *length = size - 2 - mimeLen - descLen; return &data[2 + mimeLen + descLen]; |