summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/id3/ID3.cpp
diff options
context:
space:
mode:
authorWei Jia <wjia@google.com>2015-08-18 16:33:38 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-08-18 16:33:38 +0000
commitde5c4c4671f63457151fce7b4ad7963518f8ce36 (patch)
tree73e9bdfee7dfcb46a5153179c59b2f407f9fb5ff /media/libstagefright/id3/ID3.cpp
parent9359e82213e6027b2390b76ba30e2e44f0d5cec6 (diff)
parent431312997856ce689e683ee0639cf1f4bedab7f0 (diff)
downloadframeworks_av-de5c4c4671f63457151fce7b4ad7963518f8ce36.zip
frameworks_av-de5c4c4671f63457151fce7b4ad7963518f8ce36.tar.gz
frameworks_av-de5c4c4671f63457151fce7b4ad7963518f8ce36.tar.bz2
am 43131299: am 1a09d352: Merge "libstagefright: check remaining data size before parsing it." into klp-dev
* commit '431312997856ce689e683ee0639cf1f4bedab7f0': libstagefright: check remaining data size before parsing it.
Diffstat (limited to 'media/libstagefright/id3/ID3.cpp')
-rw-r--r--media/libstagefright/id3/ID3.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/media/libstagefright/id3/ID3.cpp b/media/libstagefright/id3/ID3.cpp
index 894a9c9..a39aecf 100644
--- a/media/libstagefright/id3/ID3.cpp
+++ b/media/libstagefright/id3/ID3.cpp
@@ -509,6 +509,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