diff options
author | Marco Nelissen <marcone@google.com> | 2015-08-07 14:56:01 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-08-07 14:56:01 +0000 |
commit | 0625841daae5bb1351034909ce705aab517eea2d (patch) | |
tree | 7e77aeb1072938040bab56ba4a9ed6b48c0a8473 /media/libstagefright/id3 | |
parent | 9f7bceff18052171b3042bda945d7e4e94b60f1c (diff) | |
parent | dfaea255546340742b42c216663f61c6b7301c4f (diff) | |
download | frameworks_av-0625841daae5bb1351034909ce705aab517eea2d.zip frameworks_av-0625841daae5bb1351034909ce705aab517eea2d.tar.gz frameworks_av-0625841daae5bb1351034909ce705aab517eea2d.tar.bz2 |
am dfaea255: am 578d5b66: am 171b5fad: am d6ea7f65: am f26400c9: Fix crash on malformed id3
* commit 'dfaea255546340742b42c216663f61c6b7301c4f':
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 7f221a0..3ef175b 100644 --- a/media/libstagefright/id3/ID3.cpp +++ b/media/libstagefright/id3/ID3.cpp @@ -804,6 +804,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]; |