diff options
author | Marco Nelissen <marcone@google.com> | 2015-08-07 14:32:40 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-08-07 14:32:40 +0000 |
commit | 171b5fadb9d304f5e06686e4f3d060ef335d7250 (patch) | |
tree | 8d45331766e9cb5c701db4a8ca4e51e89f1ac5ad /media/libstagefright/id3 | |
parent | d8bb17e33ef33ce173fa2d096211785145d41921 (diff) | |
parent | d6ea7f65dd31d5dacf497cc3c494d4fa3910f7c3 (diff) | |
download | frameworks_av-171b5fadb9d304f5e06686e4f3d060ef335d7250.zip frameworks_av-171b5fadb9d304f5e06686e4f3d060ef335d7250.tar.gz frameworks_av-171b5fadb9d304f5e06686e4f3d060ef335d7250.tar.bz2 |
am d6ea7f65: am f26400c9: Fix crash on malformed id3
* commit 'd6ea7f65dd31d5dacf497cc3c494d4fa3910f7c3':
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]; |